Subject RE: [firebird-support] Token unknown: exists
Author Thomas Steinmaurer
> environment: winxpsp1 + fb1.5-rc8
> code:
> [line 9] if exists (select 1 from rdb$relations where
> rdb$relation_name = 'theTable') then ...
>
> in ibexpert I get:
>
> Invalid token.
> Dynamic SQL Error.
> SQL error code = -104.
> Token unknown - line 9, char 6.
> exists.

If you are talking about a PSQL code module, then *always*
enclose the entire condition with parentheses.

IF (EXISTS(...)) THEN ...


HTH,
Thomas Steinmaurer
Logging/Auditing Suite for InterBase and Firebird
http://www.iblogmanager.com
Logging/Auditing Suite for Advantage Database Server 7
http://www.adslogmanager.com

- I support Firebird, I am a FirebirdSQL Foundation member.
- Join today at http://www.firebirdsql.org/ff/foundation