Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: INSERT w/ RETURNING clause using DBD::Oracle
I have accomplished this in two ways. The first is to create a field that contains an incremented code associated with the row like this:
$sql = " SELECT MAX(adj_id)
FROM my_table ";
$sth = $dbh->prepare($sql);
$sth->execute() || die $sth->errstr;
$error = $sth->errstr;
$sth->bind_columns( undef,
\($test_id) );
$test_id++;
$sql=qq{INSERT INTO may_table
VALUES( $test_id, ...n)};
$sth = $dbh->prepare($sql);
$sth->execute() || die $sth->errstr;
$error = $sth->errstr;
or you can use the Oracle function called RowID to get the oracle stored
reference to the record address
Received on Fri Aug 20 1999 - 16:32:25 CDT