Re: passing php array to an Oracle function
| From: | Michael Virnstein | Date: | Sat, 18 May 2002 03:49:56 +0000 |
| Subject: | Re: passing php array to an Oracle function | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-19247@lists.php.net to get a copy of this message | ||
i cannot get this to work.
seems there's no way binding an array directly,
at least if it's of such an object type. If anyone knows a
way, i'd appreciate any advice.
But I found a solution:
$query = "declare
my_array Test_Pkg.test_array_type;
begin";
and then i loop through my php array, extending the $query string which sets
elements for my_array in the sql.
when i execute this, it works properly.
Regards Michael
"Michael Virnstein" <michael.virnstein@web.de> schrieb im Newsbeitrag
news:20020517201957.43474.qmail@pb1.pair.com...
> Hope there's any Oracle Guru around. :)
>
> Oracle 8.1.7:
> Asuming that I have the following object type:
>
> Create or Replace Type Test_Table_type as object (PK number(10,0),
>
> name varchar2(100));
>
> and that I have the following package:
>
> Create Package Test_Pkg
> Is
>
> Type test_array_type is varray(10) of Test_Table_Type;
>
> Function TestFunc(in_array IN test_array_type)
> Return number;
>
> End;
>
> and i want to call the function like this from php:
>
> $query = "begin :result := Test_Pkg.TestFunc(:array); end;";
>
> and bind a php array to the :array variable.
>
> Is this possible?
> If yes, what should the array look like?
> If not, how should i do it then?
>
> Any sample code would be really great.
>
> Regards Michael
>
>
>
>