Hello,

The goal here is to insert a single row, then get a numerical value "id"
(generated by the insert trigger) to use in another insert statement.

I get, "ORA-01008: not all variables bound" when running this script:

<?
$query = "insert into table (col1, col2) values ($val1,$val2) returning id
into :id";
$parsed = OCIParse($connection,$query);

OCIBindByName($parsed,":id",&$id,-1);

// execute first insert
$cursor = OCIExecute($parsed);

// construct and execute 2nd insert
$query2="insert into table2(id,etc) values (:id, $etc)";
$parsed2 = OCIParse($connection,$query2);
$cursor2 = OCIExecute($parsed2);
?>

It seems so simple.  What am I doing wrong?

Paul Fernandez



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to