Base Handbook Chapter 5 Queries.

While working through the documentation I appear to have found a problem.

The following query works:
SELECT "ID", "Title", "Pub_Year" FROM "Media"
It returns 8 rows.
The following query fails
SELECT "ID", "Title", "Pub_Year" FROM "Media" LIMIT 5
The error complains about 5 being an unexpected token.

I created the query in both design and sql view and get the same result. I repeated with several tables and got the same result and problem.

I found that if I used sort on a field then no matter where I created the query (design or sql mode it worked)

The documentation implies that this is a problem from earlier versions of the data base, prior to 4.1. and also the limit could only be set in direct SQL mode. I can set the limit in both modes but as stated an order field condition is rquired.My version is the one from the ubuntu repository and claims to be version libreoffice-base 1:4.2.6.3-0ubuntu1. I presume this means it is 4.2.6.3 and therefore should not have the LIMIT limitation.

If I need to load a later version of the data base where do I get it from?

If this problem is a bug where do I report it?

Regards

Peter Goggin

Hi Peter,

While working through the documentation I appear to have found a problem.

The following query works:
SELECT "ID", "Title", "Pub_Year" FROM "Media"
It returns 8 rows.
The following query fails
SELECT "ID", "Title", "Pub_Year" FROM "Media" LIMIT 5
The error complains about 5 being an unexpected token.

I have tested it with the same database and LO 4.2.7.1. The query works
as expected. Could create it in the GUI and directly in SQL without any
problems.

I created the query in both design and sql view and get the same result.
I repeated with several tables and got the same result and problem.

I found that if I used sort on a field then no matter where I created
the query (design or sql mode it worked)

There is no difference between switching from GUI to SQL-input. The code
will be interpreted by Base, when ther isn't pressed the button "SQL" to
direct processing the SQL-code.

The documentation implies that this is a problem from earlier versions
of the data base, prior to 4.1. and also the limit could only be set in
direct SQL mode. I can set the limit in both modes but as stated an
order field condition is rquired.

Really in direct SQL-Mode? You have to switch Design View off and then
press the button SQL (or go to Edit → Run SQL command directly.). The
direct mode works in every LO-version, because it is executed by the
same HSQLDB-database.

My version is the one from the ubuntu
repository and claims to be version libreoffice-base 1:4.2.6.3-0ubuntu1.
I presume this means it is 4.2.6.3 and therefore should not have the
LIMIT limitation.

If I need to load a later version of the data base where do I get it from?

You don't need any other version of the database, because the HSQLDB in
the background is the same for all LO-versions.
Don't know if this is a special problem with packages from Ubuntu.

Regards

Robert

I ran the same query without any problem using 4.2.6.3 that I downloaded from the LibreOffice web site. I also use Ubuntu as my OS (12.04) so yours should have worked.
      A couple of possible problems though:
1) Did you download Media_with_Macros.odb or Media_without_Media.odb and run create the query in one of these, or did you use the database
      you created? (If the latter, there might be a problem with your database.)
2) The LibreOffice distributed by Ubuntu has been modified from the version distributed on the LibreOffice web site. This error could be caused
      by a bug introduced by the modification process. This has been known to happen down through the years and has happened in a variety of distributions of Linux.

     For #1, you should download the English version of the database file mentioned in the Query chapter. (It probably does not matter which one.) Create and run the query. If you still get the error, the problem is with the Ubuntu version of LibreOffice.
      For #2, I always remove the Ubuntu version of LibreOfficeusing Synaptic first when I install a newer version of Ubuntu. Then I download and install the versions including the help packs that I want from the LibreOffice web site. The menu will only show the Ubuntu version unless you do it in this order. Once the Ubuntu version is deleted, all version installed from the LibreOffice web site appear in the menu.
      Right now I have LibreOffice 4.2.6.3 and 4.3.2.2 installed, and I use both versions for a variety of purposes including testing them for how Base works in both of them. Specifically, I can check the problem you have had with both versions or even 4.2.7.1.

Dan

I down loaded the sample data base Media_with_Macros.odb or Media_without_Media.odb. I was using the without version. As I am checking the documentation I am using the sample data bases rather than my own since the samples in the documentation come from the ample databases. It appears the ubuntu version of LibreBae is the cause of the problem.

I am not quite sure how I do what is required to get the proper version of the LibreBase software. (By the way as you know in ubuntu it does not come bundled with LibeOffice but requires a separate download.

Many users of librebase on ubuntu will use the version in the ubuntu repository. While I can obviously ( with some guidance) download the latest versions form the LibreOffice site, should I be checking the documentation against the ubuntu version or the official site version? Or do I need to check it against both?

There are a number of linux distributions which bundle LibreOffice in the installation. Do all of these have the same sort of problems as Ubuntu?

Regards

Peter Goggin

I retried the queries using the withmacros version of the sample data bases. This refused to load cleanly until i enabled macros. Now the queries work correctly in both databases.

Regard

Peter Goggin

Hi :slight_smile:
It is best to use the version of LibreOffice from the official LibreOffice
website.

Ubuntu (and all other distros) tend to refer to that as using the
"upstream" version. It's usually more efficient to work on the upstream
version and then each different distro only needs to worry about how it's
own one differs from that.

Typically each different distro has it's own bug-reporting process. Many
bug-reports will be solved by the distro's own devs with others being
"pushed upstream" for the LIbreOffice devs to fix. (Often this turns out
to be the same person in practice but means the fix is then in main-branch
for all different distros to use).

Translators working on Ubuntu are encouraged to do their translations
"upstream" so that the checking process only happens twice. Translations
done in Ubuntu would be checked there, pushed upstream, checked here,
arrive downstream again but still need checking again there!

Mostly the distros do as little tweaking as possible. Slackware is kinda
famous for needing the least amount of tweaking and therefore having the
purest versions of packages out of any distro but there are probably
flame-wars about that sort of thing. I think it's often claimed that
Ubuntu does the most tweaking.

I generally have most machines on the version from the normal repos. Some
are on the one from the PPA. It's pretty rare for me to need to get the
one from the official website as i rarely notice any difference between any
of them. It does happen but i just seldom notice it.

A lot of the different distros used to club together to do some commonly
needed tweaks and updates together but then some would still need their own
tweaks of that. One of the first big updates to LibreOffice was finally
absorbing that Go-oo fork into the main project and doing that pushed
LIbreOffice so far ahead of OpenOffice that Oracle had big problems trying
to catch-up with all the 'new' stuff such as 'new' functionality.

Regards from
Tom :slight_smile: