Ludányi Levente wrote:
Hello I'm trying to use the OCINewCollection function, but if I don't specify the 'schema' parameter for this function, then I get the 'ocinewcollection(): OCI8 Recursive call!' error message, and the page never appears (I must restart IIS). If I give a typename, that does not exsits on the Oracle server, then it ends up with the same results.
If I specify the 3. parameter, then I always get the 'type not found' message (OCI-22303), and the php-variable gets bool(false) value.
Oracle:
CREATE TYPE "AR"."T1" AS TABLE OF NUMBER(6, 0)
CREATE OR REPLACE PROCEDURE "AR"."GETTABLE" ( aaa out t1 ) is begin aaa:=t1(10); end;
Php:
<?php
echo 'aaa';
$c=OCILogon("ar","ar");
$s=OCIParse($c,"begin gettable(:b); end;");
$bb=OCINewCollection($c,"t1");
echo var_dump($bb);
OCIBindByName($s,"b",&$bb,-1,OCI_B_SQLT_NTY);
OCIExecute($s);
OCIFreeStatement($s);
echo 'bbb';
?>
I tested your raw script using PHP 4.3.4RC2 on W2K against Oracle 9.2 on Solaris and got:
Warning: Call-time pass-by-reference has been deprecated - argument passed by value; If you would like to pass it by reference, modify the declaration of ocibindbyname(). If you would like to enable call-time pass-by-reference, you can set allow_call_time_pass_reference to true in your INI file. However, future versions may not support this any longer. in c:\php\t26.php on line 8 aaa Warning: ocinewcollection(): OCITypeByName: OCI-22303: type ""."t1" not found in c:\php\t26.php on line 6 bool(false) Warning: ocibindbyname(): Variable must be allocated using OCINewCollection() in c:\php\t26.php on line 8
Warning: ociexecute(): OCIStmtExecute: ORA-01008: not all variables bound in c:`\php\t26.php on line 9 bbb
I removed the "&", made t1 uppercase (i.e "T1") in the OCINewCollection call and got:
aaaobject(OCI-Collection)(1) { ["collection"]=> resource(6) of type (oci8 collection) } bbb
I haven't yet tried the other scenarios you mentioned.
Chris
-- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php