Re: Efficient Insert statement for one record into multiple

From: Dave Cramer <pg(at)fastcrypt(dot)com>
To: "Peter Neu" <peter(dot)neu(at)gmx(dot)net>
Cc: <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: Efficient Insert statement for one record into multiple
Date: 2006-12-18 12:29:32
Message-ID: FE1C757C-1D9E-4C0F-AB24-030E0B8484FE@fastcrypt.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc


On 18-Dec-06, at 7:05 AM, Peter Neu wrote:

> 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?
It's safe to do it without a transaction, what you have to make sure
is that you do it with the same connection object.

Dave
>
> Cheers,
> Pete
>
>
>
>
>
>
>
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 1: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo(at)postgresql(dot)org so that
> your
> message can get through to the mailing list cleanly
>

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Roland Walter 2006-12-18 14:30:12 Re: Efficient Insert statement for one record into multiple
Previous Message Peter Neu 2006-12-18 12:05:12 Re: Efficient Insert statement for one record into multiple