Subject | Re: [IBO] Locate says unknown token |
---|---|
Author | Helen Borrie |
Post date | 2001-12-01T02:43:32Z |
At 08:18 PM 30-11-01 -0600, you wrote:
Here is your statement:
SELECT SERVICES.DAY, SERVICES.SRVC_TIME
FROM SERVICES
WHERE (((SERVICES.DAY = ? /* PRM_0 */ )))
should be either
SELECT SERVICES."DAY", SERVICES.SRVC_TIME
FROM SERVICES SERVICES
WHERE SERVICES."DAY" = :PRM_0
(i.e. the table identifiers aren't valid unless they are identifying an alias, which is necessary only in joins).
or, correctly (because this isn't a join):
SELECT "DAY", SRVC_TIME
FROM SERVICES
WHERE "DAY" = :PRM_0
Quoted identifiers are case-sensitive so, if your "DAY" column is not defined as "DAY" but as e.g. "Day" or "day", then you keep getting errors until you get the case right.
A good trick is to test your SQL statements in IB_SQL and, when they work, to copy-paste them into the IDE. You can enter parameters for your statements into either the DSQL or the Cursor pages.
cheers,
Helen
All for Open and Open for All
InterBase Developer Initiative ยท http://www.interbase2000.org
_______________________________________________________
>I have an IBOQuery that seems to work fine except for the locate command.Well, you are going to have problems with a column named DAY, if you don't double-quote it. However, the validation is actually baulking on the period following the identifier for the SERVICES table.
>When the locate executes I get the following in the monitor saying invalid
>token. The problem is probably that one of the key fields has the name
>"DAY" which may be a key word in IB dialect 3 (I've converted this app from
>Paradox tables).
Here is your statement:
SELECT SERVICES.DAY, SERVICES.SRVC_TIME
FROM SERVICES
WHERE (((SERVICES.DAY = ? /* PRM_0 */ )))
should be either
SELECT SERVICES."DAY", SERVICES.SRVC_TIME
FROM SERVICES SERVICES
WHERE SERVICES."DAY" = :PRM_0
(i.e. the table identifiers aren't valid unless they are identifying an alias, which is necessary only in joins).
or, correctly (because this isn't a join):
SELECT "DAY", SRVC_TIME
FROM SERVICES
WHERE "DAY" = :PRM_0
Quoted identifiers are case-sensitive so, if your "DAY" column is not defined as "DAY" but as e.g. "Day" or "day", then you keep getting errors until you get the case right.
A good trick is to test your SQL statements in IB_SQL and, when they work, to copy-paste them into the IDE. You can enter parameters for your statements into either the DSQL or the Cursor pages.
cheers,
Helen
All for Open and Open for All
InterBase Developer Initiative ยท http://www.interbase2000.org
_______________________________________________________