Bug #55249 [Opn->Sus]: OCI-collection->append does not reflect NLS_NUMERIC_CHARACTERS settings
| From: | sixd@php.net | Date: | Tue, 08 Nov 2011 22:12:46 +0000 |
| Subject: | Bug #55249 [Opn->Sus]: OCI-collection->append does not reflect NLS_NUMERIC_CHARACTERS settings | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-164976@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=55249&edit=1
ID: 55249
Updated by: sixd@php.net
Reported by: stloukal at programator dot cz
Summary: OCI-collection->append does not reflect
NLS_NUMERIC_CHARACTERS settings
-Status: Open
+Status: Suspended
Type: Bug
Package: OCI8 related
Operating System: Linux/Fedora 14
PHP Version: 5.3.6
Block user comment: N
Private report: N
New Comment:
After discussions with the Oracle C API team, I've logged an
enhancement against Oracle (#13361389) to enhance the C API to allow
this. This is a non trivial enhancement because it impacts the
overall ethos of the C API and would require adding a whole new set of
API function calls. I'm suspending this bug for the moment. It can
be reviewed once Oracle's C OCI8 API have support for the behavior.
Previous Comments:
------------------------------------------------------------------------
[2011-11-04 23:43:45] sixd@php.net
PHP OCI8 currently converts the string '1,2' using zend_strtod which isn't Oracle
NLS aware.
------------------------------------------------------------------------
[2011-07-20 08:05:17] stloukal at programator dot cz
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 this bug report at https://bugs.php.net/bug.php?id=55249&edit=1