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

Re: Efficient Insert statement for one record into multiple

From: "Peter Neu" <peter(dot)neu(at)gmx(dot)net>
To: <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: Efficient Insert statement for one record into multiple
Date: 2006-12-18 12:05:12
Message-ID: 01fb01c7229c$c59e0aa0$bcc8a8c0@PCMELZER (view raw or flat)
Thread:
Lists: pgsql-jdbc
Hi,

in my create table statement I got this line:

id int4 DEFAULT nextval('public.user_auth_id2_seq'::text)

So according to your suggestions this would be

insert into B (id_from_a, statistic_data) values(
currval("public.user_auth_id2_seq"),bla")

,right?

If I got you right I cannot link this two insert statements together. 
So I need two times to open a prepared statement and execute it. 
Would I need to do this in a transaction or is it safe to do this
without it?

Cheers,
Pete








In response to

Responses

pgsql-jdbc by date

Next:From: Dave CramerDate: 2006-12-18 12:29:32
Subject: Re: Efficient Insert statement for one record into multiple
Previous:From: Roland WalterDate: 2006-12-18 11:28:09
Subject: Re: Efficient Insert statement for one record into multiple

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