-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
> Also, in perl DBI, the solutions all require executing at least
> 2 sql statements.
Nothing wrong with that.
> I initially hoped there'd be a way to get the oid or sequence number
> at the same time as executing an INSERT (one sql statement),
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
> Perl's DBI has the following function.
>
> $rv = $dbh->last_insert_id($catalog, $schema, $table, $field);
> "Returns a value 'identifying' the row just inserted, if possible."
>
> I wonder what this $catalog is in this context. It's supposed to b
On Apr 14, 2004, at 10:53 AM, Ben Kim wrote:
I hope it is OK to ask the question here.
Perl's DBI has the following function.
$rv = $dbh->last_insert_id($catalog, $schema, $table, $field);
"Returns a value 'identifying' the row just inserted, if possible."
I wonder what this $catalog is in this
I hope it is OK to ask the question here.
Perl's DBI has the following function.
$rv = $dbh->last_insert_id($catalog, $schema, $table, $field);
"Returns a value 'identifying' the row just inserted, if possible."
I wonder what this $catalog is in this context. It's supposed to be
metadata, and
Thanks to those who offered help,
The suggested solutions are,
1. Select nextval('myseq'), then use the nextval as the new id to
insert a new record.
2. Insert a new record, then do select currval('myseq') or select last_val
from myseq; supposed to be safe
3. use transaction to guarantee safety
Ben Kim <[EMAIL PROTECTED]> wrote:
>
>
> Dear admins,
>
> I have a table whose primary key is a record_id with serial type.
>
> I would like to know, when I insert a new row, what was the value of the
> record_id that I just inserted. Since this is a multi user application, I
> cannot simply s
On Fri, 9 Apr 2004, Ben Kim wrote:
>
> Dear admins,
>
> I have a table whose primary key is a record_id with serial type.
>
> I would like to know, when I insert a new row, what was the value of the
> record_id that I just inserted. Since this is a multi user application, I
> cannot simply sel
Dear admins,
I have a table whose primary key is a record_id with serial type.
I would like to know, when I insert a new row, what was the value of the
record_id that I just inserted. Since this is a multi user application, I
cannot simply select max of the record_id or currval of the sequence.