Subject | Re: [firebird-support] SELECT INTO :var gives Unkown Token INTO error |
---|---|
Author | Lucas Franzen |
Post date | 2004-12-17T16:27:14Z |
Peter,
Peter Welch schrieb:
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.
Peter Welch schrieb:
>Buit you misread it.
>
> 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.
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.