Wednesday, 27 April 2016

[firebird-support] FB 3.0, how to get IDENTITY of last inserted row

 

Hello

 

In FB 2.5 I am using

 

insert into MyTable (col1, col2) values(val1, val2) returning Id

 

where Id is autoinc column (sequence generator + before insert trigger).

 

How do I do it in FB 3.0? It doesn’t like “returning Id”. It displays this error: SQLDA error. Wrong number of parameters (expected 1, got 0)

 

I have Id defined as IDENTITY. Can I get INDENTITY for the last inserted row without using SELECT GEN_ID(generator-name, 0) AS ID FROM RDB$DATABASE ?

 

I am trying this with Firebird Maestro 15.11.0.1 (supports FB 3) on Win Server 2012 R2. With FB 2.5 all works as expected.

 

 

Thank you.

Zoran

 

__._,_.___

Posted by: "Zoran" <zoran565@gmail.com>
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (1)

Upgrade your account with the latest Yahoo Mail app
Get organized with the fast and easy-to-use Yahoo Mail app. Upgrade today!

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Visit http://www.firebirdsql.org and click the Documentation item
on the main (top) menu.  Try FAQ and other links from the left-side menu there.

Also search the knowledgebases at http://www.ibphoenix.com/resources/documents/

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

.

__,_._,___

No comments:

Post a Comment