Subject Re: [firebird-support] SELECT INTO :var gives Unkown Token INTO error
Author Lucas Franzen
Peter,


Peter Welch schrieb:

>
>
> Here is the SQL that fails in IB_SQL's DSQL applied to a Firebird 1.5
> table - dialect 3, I believe:
>
> SELECT min(id) from trays where tray_no = :aTray INTO :Id;
>
> Doesn't matter where I place the INTO.
>
> 'id' is the primary key but substituting a different field yields the
> same results.
>
> Very puzzled since this is an equivalent (syntax-wise) SQL statement
> from an Interbase book.

Buit you misread it.

INTO is not SQL it's PSQL and can't be used in standard selects.
You can use it in Stored Procedures and triggers.

Rewrite your statement to:

SELECT min(id) from trays where tray_no = :aTray

or

SELECT min(id) AS ID from trays where tray_no = :aTray


Luc.