Re: ocibindbyname: ORA-01008: not all variables bound
| From: | Joe Brown | Date: | Thu, 05 Apr 2001 16:47:37 +0000 |
| Subject: | Re: ocibindbyname: ORA-01008: not all variables bound | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-8279@lists.php.net to get a copy of this message | ||
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"" <dude@dude.com> wrote in message
news:9ai699$n70$1@toye.p.sourceforge.net...
> 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: php-db-unsubscribe@lists.php.net
> For additional commands, e-mail: php-db-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>