Don't have a whole lot of practice with the OCIBindByName function, but I
seem to be having success within a recursive select statement.

I'm not useing the & operator in my implementation.  Don't know if that's a
good or a bad thing (yet), but it seems to be functioning properly.

The third parameter you have -1.  I think you want to set it to a legitimate
max field length value.  -1 is used for LOBs, ROWID and FILENAME parameters,
not run of the mill number and varchar2 fields.

perhaps:
OCIBindByName($parsed,":id",$id,32);  //may work better?

""Paul Fernandez"" <[EMAIL PROTECTED]> wrote in message
9ai699$n70$[EMAIL PROTECTED]">news:9ai699$n70$[EMAIL PROTECTED]...
> 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]
>



-- 
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