[Solved] DATEADD - Unexpected Token

Creating tables and queries
Post Reply
capemayal1
Posts: 90
Joined: Fri Dec 31, 2010 5:16 pm

[Solved] DATEADD - Unexpected Token

Post by capemayal1 »

HSQLDB 2.0
Base 3.4
Ubuntu 11.4

Previously, today, I asked about the DATEADD function. I was using it on a Windows 7 machine.

The solution that Sliderule gave me then worked excellently, and correctly.

Now, I'm doing the same database on Ubuntu, with the same tables, and with HSQLDB 2.0.

In a query to add 50 days to a date, I receive the error:
Unexpected Token: DATEADD in statement.....

The function is: DATEADD('dd', 50, "filledon")

I'm at a loss as to why this works in windows, but not linux.

I've searched, but can not find any information about this either as HSQLDB.org or by google, or in this forum.

Again, any help is appreciated.
Last edited by capemayal1 on Mon Nov 21, 2011 2:55 pm, edited 1 time in total.
User avatar
Sliderule
Volunteer
Posts: 1279
Joined: Thu Nov 29, 2007 9:46 am

Re: DATEADD - Unexpected Token

Post by Sliderule »

On your Ubuntu machine . . . from the menu, if you click on: Tools -> Options -> OpenOffice.org -> Java

What is the Java Version ?

If you click on Class Path. . .

What is the directory for the assigned archive hsqldb.jar ?

From the Menu: Edit -> Database -> Properties

What is the exact line for Datasource URL ?

What is the JDBC driver class ?

Put another way, are you really connected to your HSQL Version 2 anything database, or, are you really connected to the old Embedded Database Version 1.8 ?

Sliderule

Thanks to add [Solved] in your 1st post Subject (edit button top right) if this issue has been resolved.
capemayal1
Posts: 90
Joined: Fri Dec 31, 2010 5:16 pm

Re: DATEADD - Unexpected Token

Post by capemayal1 »

Sliderule wrote:On your Ubuntu machine . . . from the menu, if you click on: Tools -> Options -> OpenOffice.org -> Java

What is the Java Version ?

version is 1.6.0.22

If you click on Class Path. . .

What is the directory for the assigned archive hsqldb.jar ?

/home/capemayal/hsqldb-2.2.5/hsqldb/lib

From the Menu: Edit -> Database -> Properties

What is the exact line for Datasource URL ?

JDBC:hsqldb:file:/home/capemayal/documents/medical/medical;default_schema=true;shutdown=true;hsqldb.default_table_type=cached;get_column_name=false

What is the JDBC driver class ?

org.hsqldb.jdbcDriver

Put another way, are you really connected to your HSQL Version 2 anything database, or, are you really connected to the old Embedded Database Version 1.8 ?

I tested the connection and it is successful



Sliderule

Thanks to add [Solved] in your 1st post Subject (edit button top right) if this issue has been resolved.
User avatar
Sliderule
Volunteer
Posts: 1279
Joined: Thu Nov 29, 2007 9:46 am

Re: DATEADD - Unexpected Token

Post by Sliderule »

Open your OpenOffice Base file:
  1. On the left, click on Queries
  2. Under Tasks, click on: Create Query in SQL View...
  3. Copy and Paste:

    Code: Select all

    Select
       CURRENT_DATE as "Current Date",
       DATEADD('dd', 50, CURRENT_DATE) as "DateAdd Current Date + 50"
    From INFORMATION_SCHEMA.SYSTEM_TABLES
    Where TABLE_NAME = 'SYSTEM_TABLES'
  4. Run the Query . . . F5 key . . . OR . . . Run Query icon on the toolbar
  5. Does it run and return two columns, one record with appropriate values ?
ALSO, in my FIRST post here . . . in the Class Path dialog . . . is there an entry for hsqldb.jar . . . and . . . exactly what is it?

Sliderule

Thanks to add [Solved] in your 1st post Subject (edit button top right) if this issue has been resolved.
capemayal1
Posts: 90
Joined: Fri Dec 31, 2010 5:16 pm

Re: DATEADD - Unexpected Token

Post by capemayal1 »

Run Query:
The data content could not be loaded.
Unexpected Token: DATEADD in statement......

Class Path dialog:
There is no mention of hsqldb.jar

it reads:
/home/capemayal/hsqldb-2.2.5/hsqldb/lib
User avatar
Sliderule
Volunteer
Posts: 1279
Joined: Thu Nov 29, 2007 9:46 am

Re: DATEADD - Unexpected Token

Post by Sliderule »

So, you are NOT connected to the hsqldb.jar . . . you have NOT added the archive hsqldb.jar to the Class Path.

Instead, you are just connected to the hsqldb.jar file in the OpenOffice directory . . . version 1.8 . . . which does NOT support the DATEADD function.

Sliderule

Thanks to add [Solved] in your 1st post Subject (edit button top right) if this issue has been resolved.
Post Reply