Oracle(oci) variable binding - rowid

admin

Administrator
Staff member
I'm having trouble getting the rowid returned for a newly inserted record.

I want to use this to do a select on the row after it's inserted. Their is nothing unique to select by, so I need row id.

apache: 1.3.14
php: 4.0.5-dev
oracle: 8.1

Apache error message: [notice] child pid 30788 exit signal Segmentation fault (11).

I get a unrecognizeable response(IE) or zero sized reply(Squid).

here is my code: (I've got a db connection...)
//assemble query
$query = "insert into misa.invoiceitem ";
$query .= "(itemid, itemdate, transtype, itemname, quantity, itemcost, staffid, invoiceid) values";
$query .= "( 1, '$now', 'Invoice', 'Blah', '1', '12.01', '999', '20207')";
$query .= "returning ROWID into :rid";

//parse query
$Statement = ociparse($Connection, $query);

//create descriptor the abstract data type
$rowid = ocinewdescriptor($Connection, OCI_D_ROWID);

//bind input and output variables
ocibindbyname($Statement, ":rid", &$rowid, -1, OCI_B_ROWID);

//execute query, do not automatically commit
ociexecute($Statement, OCI_DEFAULT);
 
Back
Top