Handling numeric values with OCI8
633274Sep 23 2008 — edited Oct 8 2008What'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.