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

2016-04-27 Thread zoran...@yahoo.com [firebird-support]
Looks like Firebird Maestro has a bug. I've tried the same with Database 
Workbench 5 and all works as expected.

Thank you guys...
Zoran

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

2016-04-27 Thread zoran...@yahoo.com [firebird-support]
You are right. I've tried the same with Database Workbench 5 and it works ok.

Thank you, Dimitry :)

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

2016-04-27 Thread Dimitry Sibiryakov s...@ibphoenix.com [firebird-support]
27.04.2016 21:04, 'Zoran' zoran...@gmail.com [firebird-support] wrote:
> It doesn’t like “returning Id”. It displays this error: SQLDA error. Wrong 
> number of
> parameters (expected 1, got 0)

   This is an application bug. Obviously, the application hasn't prepared place 
for 
returned Id.

   For me everything work with isql:

> SQL> create table aaa(id integer generated by default as identity, col1 
> integer, col2 varchar(10));
> SQL> insert into aaa (col1, col2) values (1,'abc') returning id;
>
>   ID
> 
>1
>
> SQL> show version;
> ISQL Version: WI-T4.0.0.86-dev Firebird 4.0 Unstable
> Server version:
> Firebird/Windows/AMD/Intel/x64 (access method), version "WI-T4.0.0.86-dev 
> Firebird 4.0 Unstable"
> on disk structure version 12.0


-- 
   WBR, SD.






++

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/ 

++


Yahoo Groups Links

<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/firebird-support/

<*> Your email settings:
Individual Email | Traditional

<*> To change settings online go to:
http://groups.yahoo.com/group/firebird-support/join
(Yahoo! ID required)

<*> To change settings via email:
firebird-support-dig...@yahoogroups.com 
firebird-support-fullfeatu...@yahoogroups.com

<*> To unsubscribe from this group, send an email to:
firebird-support-unsubscr...@yahoogroups.com

<*> Your use of Yahoo Groups is subject to:
https://info.yahoo.com/legal/us/yahoo/utos/terms/



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

2016-04-27 Thread Thomas Steinmaurer t...@iblogmanager.com [firebird-support]
Hello Zoran,

>
> 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.

The following works fine for me with FB3 (server + client library):

create table t1 (
   id integer generated by default as identity primary key
   , fname varchar(15)
);

commit;

In isql:

C:\Firebird\Firebird_300_4050_x86>isql -user sysdba -password masterkey 
fb3test.fdb
Database: fb3test.fdb, User: SYSDBA
SQL> insert into t1 (fname) values ('hugo') returning id;

   ID

   15


So, in general it works. ;-)


-- 
With regards,
Thomas Steinmaurer
http://www.upscene.com/

Professional Tools and Services for Firebird
FB TraceManager, IB LogManager, Database Health Check, Tuning etc.






++

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/ 

++


Yahoo Groups Links

<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/firebird-support/

<*> Your email settings:
Individual Email | Traditional

<*> To change settings online go to:
http://groups.yahoo.com/group/firebird-support/join
(Yahoo! ID required)

<*> To change settings via email:
firebird-support-dig...@yahoogroups.com 
firebird-support-fullfeatu...@yahoogroups.com

<*> To unsubscribe from this group, send an email to:
firebird-support-unsubscr...@yahoogroups.com

<*> Your use of Yahoo Groups is subject to:
https://info.yahoo.com/legal/us/yahoo/utos/terms/



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

2016-04-27 Thread 'Zoran' zoran...@gmail.com [firebird-support]
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