ocibindbyname: ORA-01008: not all variables bound

From: Date: Thu, 05 Apr 2001 16:34:46 +0000
Subject: ocibindbyname: ORA-01008: not all variables bound
Groups: php.db 
Request: Send a blank email to php-db+get-8278@lists.php.net to get a copy of this message
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

« previous php.db (#8278) next »