rowland / fb

Firebird Extension Library for Ruby
64 stars 35 forks source link

Add support for returning values... #74

Open adrianlmm opened 4 years ago

adrianlmm commented 4 years ago

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.

jwood381 commented 4 years ago

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 :)

adrianlmm commented 3 years ago

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

adrianlmm commented 9 months ago

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?