Skip site navigation (1) Skip section navigation (2)

Re: [GENERAL] how to insert from sequence

From: Alain TESIO <alain_tesio(at)yahoo(dot)com>
To: soundar rajan <psrajan(at)yahoo(dot)com>, pgsql-general(at)postgreSQL(dot)org
Subject: Re: [GENERAL] how to insert from sequence
Date: 1999-10-27 15:22:33
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-general
> Hi all,
> I need help in inserting a value from sequence.  My
> code goes like this (from Java).  I do face a syntax
> level problem.
> statement.execute("insert into T_name (id) values (" +
> nextval('s_name') + ")");
> Thanks in advance for the help.

nextval is a sql function, not java so it must be sent inside
the string to execute :

statement.execute("insert into T_name (id) values 


Do You Yahoo!?
Bid and sell for free at

pgsql-general by date

Next:From: Aaron J. SeigoDate: 1999-10-27 15:39:10
Subject: Re: [GENERAL] FW: inheritance of functions
Previous:From: Ross J. ReedstromDate: 1999-10-27 15:09:13

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group