I'd like to get the ID of a particular row from within a Firebird 2.1 stored procedure. I can't seem to remember the syntax, and it's driving me nuts.
This is how the code might look in TSQL, used by Microsoft SQL Server.
@ID = SELECT ID FROM ADDRESS WHERE
POBox = :POBOX AND
ExtendedAddress = :EXTENDEDADDRESS AND
StreetAddress = :STREETADDRESS AND
Locality = :LOCALITY AND
Region = :REGION AND
PostalCode = :POSTALCODE AND
CountryName = :COUNTRYNAME;
What's the Firebird equivalent?
UPDATE: The Firebird SQL migration guide suggests that this should work
SELECT ID INTO :ID FROM ADDRESS WHERE
POBox = :POBOX AND
ExtendedAddress = :EXTENDEDADDRESS AND
StreetAddress = :STREETADDRESS AND
Locality = :LOCALITY AND
Region = :REGION AND
PostalCode = :POSTALCODE AND
CountryName = :COUNTRYNAME;
But I get a syntax error at "INTO" when I try to create the stored proc.