Skip to Main Content

DevOps, CI/CD and Automation

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

PHP reads decimals with commas instead dots

792182Aug 18 2010 — edited Aug 19 2010
I have a script that copies Oracle table to Firebird/Interbase.
Oracle database is set to:

NLS_NCHAR_CHARACTERSET AL16UTF16
NLS_LANGUAGE POLISH
NLS_TERRITORY POLAND
NLS_CURRENCY zl
NLS_ISO_CURRENCY POLAND
NLS_NUMERIC_CHARACTERS ,

I have a problem with decimals returned by Oracle. Query result has decimals with "," what causes conversion error on insert to Firebird.
Is there a way to configure conection parameters to receive numbers formated with "."
I could go through each row value to check if it's decimal and substitute "," to ".", whitch will add extra processing to the script

At the moment I supply INSERT statement values as shown bellow

For each
$row = oci_fetch_assoc($stmt)

I create array with parameters strings
$params[$k] = '$row[\''.$k.'\']';

and finally evaluate:
eval('ibase_execute($prep_query,'.join(',',$params).');');
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 16 2010
Added on Aug 18 2010
4 comments
2,097 views