On Mon, Apr 28, 2008 at 4:33 PM, Nacef LABIDI <[EMAIL PROTECTED]> wrote:
> Hi all,
>
> I am writing some code to get the current value of a sequence using the
> currval function to use this value in a following insert on another table.
> But I am having this message "currval of sequence "my_seq" is
Hi all,
I am writing some code to get the current value of a sequence using the
currval function to use this value in a following insert on another table.
But I am having this message "currval of sequence "my_seq" is not yet
defined in this session".
Can someone explain me what is the problem wit
silly_sad wrote:
id default value is always set by the trigger before insert on each
table for each row.
The particular subproblem is to
insert one record into ttt1
and then insert corresponding record into ttt,
___This is the place to use currval.
I'd be tempted to turn it the other way ar
On Tue, Jan 22, 2008 at 10:16:30AM +0300, silly_sad wrote:
> INSERT INTO ttt (a,b) SELECT currval('ttt_id_seq'), 'const' FROM ttt2;
> Where the trigger before insert on ttt is defined and this trigger calls
> nextval('ttt_id_seq').
> I was surprised having different values of currval() in ttt.a
>
Richard Huxton wrote:
sad wrote:
Richard Huxton wrote:
Then this is the question on the execution order of the statement
INSERT...SELECT...
You'll want "Overview of PostgreSQL internals" then
http://www.postgresql.org/docs/8.2/static/overview.html
What do you think should happen?
I had
sad wrote:
Richard Huxton wrote:
Then this is the question on the execution order of the statement
INSERT...SELECT...
You'll want "Overview of PostgreSQL internals" then
http://www.postgresql.org/docs/8.2/static/overview.html
What do you think should happen?
I had expected all the currva
sad wrote:
Guillaume Lelarge wrote:
sad wrote:
A. Kretschmer wrote:
is it expected that the currval() changes its value between calls
within one statement ?
Conclusion, don't call nextval() within a TRIGGER, and insert either
nextval() for the column or omit this column.
I only note that
Richard Huxton wrote:
sad wrote:
A. Kretschmer wrote:
is it expected that the currval() changes its value between calls
within one statement ?
Conclusion, don't call nextval() within a TRIGGER, and insert either
nextval() for the column or omit this column.
I only note that i still want t
sad wrote:
A. Kretschmer wrote:
is it expected that the currval() changes its value between calls
within one statement ?
Conclusion, don't call nextval() within a TRIGGER, and insert either
nextval() for the column or omit this column.
I only note that i still want to discuss the titled pr
sad wrote:
A. Kretschmer wrote:
is it expected that the currval() changes its value between calls
within one statement ?
Conclusion, don't call nextval() within a TRIGGER, and insert either
nextval() for the column or omit this column.
I only note that i still want to discuss the titled pr
A. Kretschmer wrote:
is it expected that the currval() changes its value between calls within
one statement ?
Conclusion, don't call nextval() within a TRIGGER, and insert either
nextval() for the column or omit this column.
I only note that i still want to discuss the titled problem or to
am Tue, dem 22.01.2008, um 10:16:30 +0300 mailte silly_sad folgendes:
> Helo
>
> is it expected that the currval() changes its value between calls within
> one statement ?
>
> Look the following call:
>
> INSERT INTO ttt (a,b) SELECT currval('ttt_id_seq'), 'const' FROM ttt2;
This fails if you
Helo
is it expected that the currval() changes its value between calls within
one statement ?
Look the following call:
INSERT INTO ttt (a,b) SELECT currval('ttt_id_seq'), 'const' FROM ttt2;
Where the trigger before insert on ttt is defined and this trigger calls
nextval('ttt_id_seq').
I
--- Tom Lane <[EMAIL PROTECTED]> wrote:
> or that the last one that's touched is the one you want?
Correct.
__
Do you Yahoo!?
Yahoo! Search - Find what youre looking for faster
http://search.yahoo.com
---(end of broadcast)---
ow <[EMAIL PROTECTED]> writes:
> I guess I could but then:
> 1) I'd still have to know the sequence name. When integrating pgSql
> with 3party frameworks I'd either have to pass it there (could be a
> very difficult task) or make some assumptions (also not very good).
This scenario is really enti
On Tuesday 09 March 2004 13:50, ow wrote:
> Hi,
>
> Is there a way to retrieve the current value (i.e. the last used value) of
> the last used sequence without specifying the sequence name? Something like
> the following:
>
> create table ( id serial, value varchar(10));
> insert into someOthertest
O kyrios ow egrapse stis Mar 9, 2004 :
>
> --- Achilleus Mantzios <[EMAIL PROTECTED]> wrote:
> >
> > You could use the same sequence in many tables.
> >
>
> I guess I could but then:
>
> 1) I'd still have to know the sequence name. When integrating pgSql with 3party
> frameworks I'd either ha
--- Achilleus Mantzios <[EMAIL PROTECTED]> wrote:
>
> You could use the same sequence in many tables.
>
I guess I could but then:
1) I'd still have to know the sequence name. When integrating pgSql with 3party
frameworks I'd either have to pass it there (could be a very difficult task) or
make
O kyrios ow egrapse stis Mar 9, 2004 :
> Hi,
>
> Is there a way to retrieve the current value (i.e. the last used value) of the
> last used sequence without specifying the sequence name? Something like the
> following:
>
> create table ( id serial, value varchar(10));
> insert into someOthertest
Hi,
Is there a way to retrieve the current value (i.e. the last used value) of the
last used sequence without specifying the sequence name? Something like the
following:
create table ( id serial, value varchar(10));
insert into someOthertest (value) values ('100');
insert into test (value) values
Hi,
I'm executing the following statements in series.
insert into [tablename] values('a', 'b', 'c');
select currval('serial');
serial being the default index on [tablename]
The statement works fine from the command line, however, when executing via
jdbc, I'm getting no results back (null po
21 matches
Mail list logo