You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-java@ibatis.apache.org by "omarcioRibeiro()" <om...@gmail.com> on 2004/12/13 18:53:28 UTC

Sequence postgresql

Hello personal...
I am beginning to use the iBATiS and I am with a problem.
how does to recover him/it number of the sequence generated by the
postgreSQL in an insert?

In the psql I use like this.

insert into customer (name)values('name_customer');
select currval ('sequence_name_sequence')

my structures of the table:
Table customer (
code serial,        -- is as sequence
name varchar(150));

how to do in the ibatis?
Thank you personal

Re: Sequence postgresql

Posted by Clinton Begin <cl...@gmail.com>.
See the <selectKey> element in the user documentation available from
the website.

Cheers,
Clinton


On Mon, 13 Dec 2004 15:53:28 -0200, omarcioRibeiro()
<om...@gmail.com> wrote:
> Hello personal...
> I am beginning to use the iBATiS and I am with a problem.
> how does to recover him/it number of the sequence generated by the
> postgreSQL in an insert?
> 
> In the psql I use like this.
> 
> insert into customer (name)values('name_customer');
> select currval ('sequence_name_sequence')
> 
> my structures of the table:
> Table customer (
> code serial,        -- is as sequence
> name varchar(150));
> 
> how to do in the ibatis?
> Thank you personal
>