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
Operating System: Redhat, Debian
PHP Version: 5.1.4
New Comment:
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;
Previous Comments:
------------------------------------------------------------------------
[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.
------------------------------------------------------------------------
[2006-05-24 17:47:30] jlevy at imerica dot com
Description:
------------
Please note that this relates to 5.1.2, not 5.1.4.
Configuration:
Box #1 - PHP 5.1.2 compiled against oracle instant client 10.x,
Debian
Box #2 - PHP 5.1.2 compiled against oracle full libs, Redhat
Calling oci_bind_array_by_name will append extraneous members to input
array if using SQLT_AFC or SQLT_AVC (other types untested due to lack
of due dilligence)
Sample script to reproduce bug at pastebin.com, see URL below.
Reproduce code:
---------------
http://http://pastebin.com/735456
Expected result:
----------------
Array
(
[0] => LH
[1] => JC
[2] => PJ
)
Array
(
[0] => LH
[1] => JC
[2] => PJ
)
Array
(
[0] => LH
[1] => JC
[2] => PJ
)
Actual result:
--------------
Array
(
[0] => LH
[1] => JC
[2] => PJ
)
Array
(
[0] => LHJCPJ
[1] => JCPJ
[2] => PJ
)
Array
(
[0] => LHJCPJ
[1] => JCPJ
[2] => PJ
[3] => JCPJ
[4] => PJ
)
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=37581&edit=1