I would like to return the ids which have been deleted by a DELETE query.
On Stackoverlow, I found this: How to get ID of the last updated row in MySQL?
The top1 answer has a very nice solution, but it's for mysql. I tried to do the same in Firebird after reading some part of the Firebird manual:
set term ^ ;
EXECUTE BLOCK
AS
DECLARE VARIABLE uids BLOB SUB_TYPE TEXT;
begin
DELETE FROM CATEGORY WHERE name = 'Haló'
AND ( SELECT id INTO :uids );
SELECT @uids;
end
^
Yes, I know that 'uids' will always contain one ID, since I'm overwriting the variable, but it's only a test, and what is more, it doesn't work. It stops at 'INTO' saying "Token unknown - line 8, column 21". I don't know what to do, what to continue with.. :\
Thanks for Your help!