Subject | RE: [firebird-support] Other way of specifying INSERT INTO... RETURNING... |
---|---|
Author | Svein Erling Tysvær |
Post date | 2012-09-24T06:23:12Z |
>Hi list,EXECUTE BLOCK RETURNS(TheID integer)
>
>Firebird 2.5 Linux server.
>
>I'm trying to work around a bug in the FreePascal 2.6.0 compiler that thinks all INSERT statements never return data. This >bug has been worked on since but 2.6.0 is the last stable version so I'd prefer to be able to support that.
>
>I'm trying to fool the compiler and rewrite my query into something like SELECT (INSERT INTO i (PATH) VALUES >('\somewhere\over\the\rainbow') RETURNING ID) AS TheID FROM IMAGES i
>
>Any suggestions?
AS
BEGIN
INSERT INTO i (PATH) VALUES ('\somewhere\over\the\rainbow') RETURNING ID INTO TheID;
SUSPEND;
END
HTH,
Set