From:             
Operating system: Linux/Fedora 14
PHP version:      5.3.6
Package:          OCI8 related
Bug Type:         Bug
Bug description:OCI-collection->append does not reflect NLS_NUMERIC_CHARACTERS 
settings

Description:
------------
After connection to Oracle database script runs alter session command to
change NLS_NUMERIC_CHARACTERS (',' is decimal separator and '.' is
thousands separator). But using the OCI-Collection->append procedure on
collection of numbers, all decimals are stripped (the input values into
OCI-Collection->append procedure use comma as decimal separator - along to
current NLS setting).

Function oci_bind_by_name reflects NLS setting well.

Test script:
---------------
sqlplus> CREATE TYPE username.num_tab IS TABLE OF NUMBER(8,5);

<?PHP

$i_con = oci_connect('username', 'password', 'localhost/devel1');

$i_rs = oci_parse($i_con, "ALTER SESSION SET NLS_NUMERIC_CHARACTERS =
',.'");
oci_execute($i_rs, OCI_DEFAULT);

$i_col = oci_new_collection($i_con, 'NUM_TAB', 'USERNAME');
$i_col->append('1,2');

$i_rs = oci_parse(
    $i_con,
    "DECLARE
        l_nums      username.num_tab := :nums;
    BEGIN
        raise_application_error(-20000, 'First number in collection is: '
|| l_nums(1));
    END;"
);
oci_bind_by_name($i_rs, ':nums', $i_col, -1, SQLT_NTY);
oci_execute($i_rs, OCI_DEFAULT);

?>


Expected result:
----------------
Warning: oci_execute() [function.oci-execute]: ORA-20000: First number in
collection is: 1,2 ORA-06512: at line 4 in...

Actual result:
--------------
Warning: oci_execute() [function.oci-execute]: ORA-20000: First number in
collection is: 1 ORA-06512: at line 4 in...

-- 
Edit bug report at https://bugs.php.net/bug.php?id=55249&edit=1
-- 
Try a snapshot (PHP 5.2):            
https://bugs.php.net/fix.php?id=55249&r=trysnapshot52
Try a snapshot (PHP 5.3):            
https://bugs.php.net/fix.php?id=55249&r=trysnapshot53
Try a snapshot (trunk):              
https://bugs.php.net/fix.php?id=55249&r=trysnapshottrunk
Fixed in SVN:                        
https://bugs.php.net/fix.php?id=55249&r=fixed
Fixed in SVN and need be documented: 
https://bugs.php.net/fix.php?id=55249&r=needdocs
Fixed in release:                    
https://bugs.php.net/fix.php?id=55249&r=alreadyfixed
Need backtrace:                      
https://bugs.php.net/fix.php?id=55249&r=needtrace
Need Reproduce Script:               
https://bugs.php.net/fix.php?id=55249&r=needscript
Try newer version:                   
https://bugs.php.net/fix.php?id=55249&r=oldversion
Not developer issue:                 
https://bugs.php.net/fix.php?id=55249&r=support
Expected behavior:                   
https://bugs.php.net/fix.php?id=55249&r=notwrong
Not enough info:                     
https://bugs.php.net/fix.php?id=55249&r=notenoughinfo
Submitted twice:                     
https://bugs.php.net/fix.php?id=55249&r=submittedtwice
register_globals:                    
https://bugs.php.net/fix.php?id=55249&r=globals
PHP 4 support discontinued:          
https://bugs.php.net/fix.php?id=55249&r=php4
Daylight Savings:                    https://bugs.php.net/fix.php?id=55249&r=dst
IIS Stability:                       
https://bugs.php.net/fix.php?id=55249&r=isapi
Install GNU Sed:                     
https://bugs.php.net/fix.php?id=55249&r=gnused
Floating point limitations:          
https://bugs.php.net/fix.php?id=55249&r=float
No Zend Extensions:                  
https://bugs.php.net/fix.php?id=55249&r=nozend
MySQL Configuration Error:           
https://bugs.php.net/fix.php?id=55249&r=mysqlcfg
Try a snapshot (PHP 5.4):            
https://bugs.php.net/fix.php?id=55249&r=trysnapshot54

Reply via email to