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!

Handling numeric values with OCI8

633274Sep 23 2008 — edited Oct 8 2008
What's the best approach to handle numeric values (more specifically, decimal and floating point values) obtained with oci_fetch_assoc() and the like? I've set NLS_LANG to SPANISH_SPAIN.WE8ISO8859P15 because I want to store Spanish language data using the ISO-8859-15 charset but that has the side effect of making SELECT 3.14 FROM DUAL become *"3,14"*. I can think of several solutions:
* Avoid PHP type juggling; instead, write a custom PHP function to parse formatted floats from strings
* Set NLS_LANG to SPANISH_AMERICA.WE8ISO8859P15
* Use PEAR MDB2 abstraction layer, which apparently ignores NLS_LANG
... but they all look like newbie workarounds...

The server runs Oracle 10g.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 5 2008
Added on Sep 23 2008
3 comments
2,750 views