Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: INSERT w/ RETURNING clause using DBD::Oracle

Re: INSERT w/ RETURNING clause using DBD::Oracle

From: bwest <bwest_at_sdsc.edu>
Date: Fri, 20 Aug 1999 14:32:25 -0700
Message-ID: <37BDC969.FEFB532E@sdsc.edu>



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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US