Subject Re: [ib-support] Select syntax
Author Claudio Valderrama C.
""Luiz Alves"" <cprmlao@...> wrote in message
> I noted a sql statement as:
> select* from agenda
> Using IBO:
> 1. with ib_cursor, there is no error.
> 2 .with a query form, there is an AV.
> Using IBaccess and IBConsole, no error is reported.

I'm going to paraphrase Doug: unfortunately, our DSQL parser sucks.

select*from rdb$database;

select(1)from rdb$database;

create domain d char(10) default'no_space';

select udf(values)from rdb$database;

select quart_head_cnt[1]from proj_dept_budget;

are all valid statements. The parser needs an space to separate token, but
when the token itself is a delimiter like parenthesis, brackets, single
quotes, double quotes or the asterisk (that cannot be combined with another
operator), the parser doesn't need and doesn't enforce a space.

When in doubt, please try isql. The advantage of isql is that it doesn't
interpret the SQL statement. In other words, isql doesn't parse SQL, it only
does a primitive parsing to detect if it received one of its own commands
(like SHOW) and if it didn't, it will pass the original command line to the

If you are seeing an AV in IBO you can consider that an IBO bug. However,
IBO probably is being a bit less flexible albeit more reasonable when it
comes to parsing. Unfortunately, the engine rules, so a third-party package
is expected to support the engine's syntax.

Claudio Valderrama C. - -
Independent developer
Owner of the Interbase® WebRing