Subject | RE: [IBO] SQL SELECT problem |
---|---|
Author | Philip A. Stephens |
Post date | 2003-03-14T13:32:55Z |
the following (typed directly into interactive SQL in IBOConsole) returns 9
rows:
SELECT * FROM FCDX_ZONES WHERE DESCRIPTION CONTAINING 'A14' ORDER BY
DESCRIPTION
changing this to:
SELECT FIRST 5 * FROM FCDX_ZONES WHERE DESCRIPTION CONTAINING 'A14' ORDER BY
DESCRIPTION
results in (Cut and paste this time):
<<ISC ERROR CODE:335544569
ISC ERROR MESSAGE:
Dynamic SQL Error
SQL error code = -104
Token unknown - line 2, char 6
,
STATEMENT:
TIBOInternalDataset:
"<TApplication>.frmMain.dlgWisql_3.<TIBOQuery>.<TIBOInternalDataset>."
Statement: SELECT FIRST 5 * FROM FCDX_ZONES WHERE DESCRIPTION CONTAINING
'A14' ORDER BY DESCRIPTION >>
The same query, cut and pasted into IBAccess results in 5 rows returned.
This is a different query than previously (below) described, but on the same
table.
the following:
SELECT FIRST 10 * FROM MPERSON WHERE PERLAST CONTAINING 'STE' ORDER BY
PERLAST
against a table in the same database results in 10 records...
The DB is Firebird 1.0 on Windows 2000 and Win NT4. The database uses
Dialect 3. The results using IBO_XXX V4.2.I is the same.
There are no hidden characters, (I retyped the whole string, etc) and the
above is pasted from IBO_Console. The contents of 'XXX' is normally suppled
dynamically and always seems to cause the error. I have just dropped the
table and re-built it with ISQL and get the same results. The problem
persists between a local DB (Win 2000 Laptop) and the server (Win NT4 SP6).
The constant is that against this table anything with 'FIRST X' fails, but
works (as above) in a different query. I am at a loss, I can work around the
problem, but would like to know what I am doing wrong!!!
Any help appreciated - Phil Stephens :-(
PS: Helen... Having read the interview... I thought we (Aussies) drove you
crazy by calling Australia "the main island". ;-)
-----Original Message-----
From: Helen Borrie [mailto:helebor@...]
Sent: Friday, 14 March 2003 14:07
To: IBObjects@yahoogroups.com
Subject: RE: [IBO] SQL SELECT problem
At 01:44 PM 14/03/2003 +1100, you wrote:
Can I suggest you just simply delete the sql and enter it again?
These statements work just as expected in an ib_cursor:
select first 10 * from topic
where responder containing 'as'
order by responder
(returns the expected 10 rows)
select first 10 * from topic
where responder containing 'as-'
order by responder
(returns an empty set - no matches)
select first 10 * from topic
where ((responder containing 'as') or
(responder containing 'as-'))
order by responder
(returns the expected 10 rows)
You could just have a rogue ` character there...or something...
Helen
___________________________________________________________________________
IB Objects - direct, complete, custom connectivity to Firebird or InterBase
without the need for BDE, ODBC or any other layer.
___________________________________________________________________________
http://www.ibobjects.com - your IBO community resource for Tech Info papers,
keyword-searchable FAQ, community code contributions and more !
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
rows:
SELECT * FROM FCDX_ZONES WHERE DESCRIPTION CONTAINING 'A14' ORDER BY
DESCRIPTION
changing this to:
SELECT FIRST 5 * FROM FCDX_ZONES WHERE DESCRIPTION CONTAINING 'A14' ORDER BY
DESCRIPTION
results in (Cut and paste this time):
<<ISC ERROR CODE:335544569
ISC ERROR MESSAGE:
Dynamic SQL Error
SQL error code = -104
Token unknown - line 2, char 6
,
STATEMENT:
TIBOInternalDataset:
"<TApplication>.frmMain.dlgWisql_3.<TIBOQuery>.<TIBOInternalDataset>."
Statement: SELECT FIRST 5 * FROM FCDX_ZONES WHERE DESCRIPTION CONTAINING
'A14' ORDER BY DESCRIPTION >>
The same query, cut and pasted into IBAccess results in 5 rows returned.
This is a different query than previously (below) described, but on the same
table.
the following:
SELECT FIRST 10 * FROM MPERSON WHERE PERLAST CONTAINING 'STE' ORDER BY
PERLAST
against a table in the same database results in 10 records...
The DB is Firebird 1.0 on Windows 2000 and Win NT4. The database uses
Dialect 3. The results using IBO_XXX V4.2.I is the same.
There are no hidden characters, (I retyped the whole string, etc) and the
above is pasted from IBO_Console. The contents of 'XXX' is normally suppled
dynamically and always seems to cause the error. I have just dropped the
table and re-built it with ISQL and get the same results. The problem
persists between a local DB (Win 2000 Laptop) and the server (Win NT4 SP6).
The constant is that against this table anything with 'FIRST X' fails, but
works (as above) in a different query. I am at a loss, I can work around the
problem, but would like to know what I am doing wrong!!!
Any help appreciated - Phil Stephens :-(
PS: Helen... Having read the interview... I thought we (Aussies) drove you
crazy by calling Australia "the main island". ;-)
-----Original Message-----
From: Helen Borrie [mailto:helebor@...]
Sent: Friday, 14 March 2003 14:07
To: IBObjects@yahoogroups.com
Subject: RE: [IBO] SQL SELECT problem
At 01:44 PM 14/03/2003 +1100, you wrote:
>The external single quotes are not passed in, and the first statement:Phil,
>
>SELECT * FROM FCDX_ZONES WHERE ADDRESS CONTAINING '01-' ORDER BY ADDRESS
>
>works fine, it is only the additional < FIRST 10 > which seems to break it,
>as in:
>
>SELECT FIRST 10 * FROM FCDX_ZONES WHERE ADDRESS CONTAINING '01-' ORDER BY
>ADDRESS
>
>The release notes show this as a valid syntax, and the rest of the query
>works fine elsewhere.
Can I suggest you just simply delete the sql and enter it again?
These statements work just as expected in an ib_cursor:
select first 10 * from topic
where responder containing 'as'
order by responder
(returns the expected 10 rows)
select first 10 * from topic
where responder containing 'as-'
order by responder
(returns an empty set - no matches)
select first 10 * from topic
where ((responder containing 'as') or
(responder containing 'as-'))
order by responder
(returns the expected 10 rows)
You could just have a rogue ` character there...or something...
Helen
___________________________________________________________________________
IB Objects - direct, complete, custom connectivity to Firebird or InterBase
without the need for BDE, ODBC or any other layer.
___________________________________________________________________________
http://www.ibobjects.com - your IBO community resource for Tech Info papers,
keyword-searchable FAQ, community code contributions and more !
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/