Subject | Other way of specifying INSERT INTO... RETURNING... |
---|---|
Author | Reinier Olislagers |
Post date | 2012-09-24T03:38:24Z |
Hi list,
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
However I get:
Dynamic SQL Error
SQL error code = -104
Token unknown - line 4, column 1
INSERT
Any suggestions?
If need be, I can of course split the SQL up into a SELECT for a
generator/sequence value and a simple INSERT INTO... but I'd rather not.
Thanks,
Reinier
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
However I get:
Dynamic SQL Error
SQL error code = -104
Token unknown - line 4, column 1
INSERT
Any suggestions?
If need be, I can of course split the SQL up into a SELECT for a
generator/sequence value and a simple INSERT INTO... but I'd rather not.
Thanks,
Reinier