fb icon indicating copy to clipboard operation
fb copied to clipboard

Add support for returning values...

Open adrianlmm opened this issue 5 years ago • 3 comments

Greetings, is not possible to retrieve values in statements with the RETURNING clause, example:

INSERT INTO EMPLOYEES (NAME) VALUES('PETER') RETURNING ID

After the execution this stament returns the autogenerated ID but is not possible to retrieve it in the current version of fb.

adrianlmm avatar May 10 '20 03:05 adrianlmm

The "returning" clause actual is supported, but sometimes doesn't work due to configuration error. I think the issue has to with copying libraries to proper folder but I have been unable to reliable recreate the problem. Sorry, I can't be more helpful :)

jwood381 avatar Jun 16 '20 22:06 jwood381

Returnig values stopped working in the recent versions of Firebird, the developers changed the behavior and now is not working.

adrianlmm avatar Sep 29 '20 19:09 adrianlmm

I believe the issue is in the line 2065 of fb.c

isc_dsql_execute2(fb_connection->isc_status, &fb_connection->transact, &fb_cursor->stmt, SQLDA_VERSION1, NULL, NULL);

The last parameter should be a pointer to an out buffer when the statement type is "isc_info_sql_stmt_exec_procedure", that's the statement type when the query contains the RETURNING keyword.

Can anyone check it out?

adrianlmm avatar Oct 06 '23 18:10 adrianlmm