>Что есть переменная в программе?
>в физическом, так сказать, смысле?
наверное какой-то кусочек оперативной памяти?
нашел что-то в инете
а кто-то пробовал через "declare", как ниже описано?
http://marc.theaimsgroup.com/?l=php-db&m=102169380328627&w=2
List: php-db
Subject: [PHP-DB] Re: passing php array to an Oracle function
From: 217.229.57.174
Date: 2002-05-18 3:49:56
[Download message RAW]
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" <
[email protected]> schrieb im Newsbeitrag
news:
[email protected]...
> 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