Subject | Re: [firebird-support] check for exist with assignment |
---|---|
Author | Mark Rotteveel |
Post date | 2013-11-10T08:10:36Z |
On 10-11-2013 07:31, Daniel L. Miller wrote:
Firebird has two selects, one with the INTO clause and one without. The
SELECT with INTO clause is only allowed in PSQL as a separate statement,
or as part of a FOR SELECT ... DO.
An EXISTS only allows a 'normal' select (that is: without an INTO clause).
Mark
--
Mark Rotteveel
> Building a procedure - why is this rejected:The Firebird syntax doesn't allow an INTO in this context. Technically
>
> if ( exists( select ID from CITIES where CITY = :NEWCITY into :NEWID ) )
> then begin
> suspend;
> end
>
> the error is on the 'into' word
>
> but this is accepted:
>
> if ( exists( select ID from CITIES where CITY = :NEWCITY ) ) then begin
> select ID from CITIES where CITY = :NEWCITY into :NEWID;
> suspend;
> end
>
Firebird has two selects, one with the INTO clause and one without. The
SELECT with INTO clause is only allowed in PSQL as a separate statement,
or as part of a FOR SELECT ... DO.
An EXISTS only allows a 'normal' select (that is: without an INTO clause).
Mark
--
Mark Rotteveel