ID: 37581
User updated by: jlevy at imerica dot com
Reported By: jlevy at imerica dot com
-Status: Feedback
+Status: Open
-Bug Type: OCI8 related
+Bug Type: Oracle related
Operating System: Redhat, Debian
PHP Version: 5.1.4
New Comment:
/*
* Oracle package for test procedure. required to define user
* defined type.
*/
create or replace package phptest as
type str_array is table of char(2) index by binary_integer;
/**
* procedure accepting a char input array and a string output.
*/
procedure array_bind(in_str in str_array, out_str out string); end
phptest; / show errors;
create or replace package body phptest as
procedure array_bind(in_str in str_array, out_str out string) is
begin
for i in 1 .. in_str.count loop
out_str := in_str(i);
end loop;
end array_bind;
end phptest;
/
show errors;
PHP Code as Follows:
$db = oci_connect('user','pass'.','server');
$stmt = oci_parse($db,'begin phptest.array_bind(:in_arr,
:out_str); end;');
$strings = array('A','B','C','D','E');
oci_bind_array_by_name($stmt,':in_arr',$strings,5,1,SQLT_AFC);
oci_bind_by_name($stmt,':out_str',$result,10);
oci_execute($stmt);
echo "values of Strings array after 1st run:\n"; print_r($strings);
oci_execute($stmt); echo "values of Strings array after 2nd run:\n";
print_r($strings);
Previous Comments:
------------------------------------------------------------------------
[2006-05-24 18:46:06] [EMAIL PROTECTED]
Could you please just provide a dummy procedure which can help me to
replicate the problem?
I don't have quote.quote_plan table and I guess I'll need even more
tables, triggers and stored procedures just to recreate a simple
problem.
Thanks.
------------------------------------------------------------------------
[2006-05-24 18:36:31] jlevy at imerica dot com
create or replace package QUOTE.MANAGE_QUOTE
is
/**
* collection of plan_ids
*/
type array_plan_id is table of char(2) index by binary_integer;
/**
* collection of premiums for a plan and quote id
*/
type array_premium is table of number(16,4) index by
binary_integer;
/**
* Adds a lot of plans to quote.
*
* Accepts two arrays, one for plan ids and another for premium and
loads them into the database in one
* sweep. If the reload parameter is set to Y all existing plan
associations will be removed from
* the database.
*
* @param in_quote_id in int quote id to add plans to
* @param in_plan_id in array_plan_id integer indexed array of plans to
add
* @param in_premium in array_premium integer indexed array of premiums
for the corresponding record in plan_id
* @param reload Y or N. Determines if we should flush all
plans already saved in the database
*/
procedure add_plan(in_quote_id in int, in_plan_id in array_plan_id,
in_premium in array_premium,reload in string);
end MANAGE_QUOTE;
create or replace package body QUOTE.MANAGE_QUOTE
as
procedure add_plan(in_quote_id in int, in_plan_id in array_plan_id,
in_premium in array_premium,reload in string) is
begin
if(reload = 'Y') then
delete quote.quote_plan where quote_id = in_quote_id;
commit;
end if;
for i in 1 .. in_plan_id.count loop
insert into quote.quote_plan(quote_id,plan_id,premium)
values(in_quote_id,in_plan_id(i),in_premium(i));
end loop;
commit;
end add_plan;
end MANAGE_QUOTE;
------------------------------------------------------------------------
[2006-05-24 18:00:28] [EMAIL PROTECTED]
I don't think I have a quote.manage_quote.add_plan() procedure, so your
reproduce case is not very useful.
------------------------------------------------------------------------
[2006-05-24 17:51:13] jlevy at imerica dot com
Another developer in my office verified this bug is also present in PHP
5.1.4
Thank you.
------------------------------------------------------------------------
[2006-05-24 17:49:50] jlevy at imerica dot com
Apologies for bad pastebin URL. Strip the excess http:// and it should
load properly.
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/37581
--
Edit this bug report at http://bugs.php.net/?id=37581&edit=1