![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I'm playing with PHP and its oci8 extension and I'm facing a curious issue: numeric fields are returned as strings and, to make it worse, they're formatted using locale settings (well, sort of). For instance: 1234.56 ---> "1234,56" According to the documentation I've read, it isn't a bug: it's intentional. The "Underground PHP and Oracle Manual" describes the problem but it doesn't suggest any solution. Am I supposed to write a custom parser to convert numeric strings into floats and pray that the DBA will never change the locale settings? Is it enough to run... alter session set nls_territory=america nls_language=american ... when I open the (persistent) connection? (I still get strings but at least they're easy to cast.) |
#3
| |||
| |||
|
|
I'm playing with PHP and its oci8 extension and I'm facing a curious issue: numeric fields are returned as strings and, to make it worse, they're formatted using locale settings (well, sort of). For instance: 1234.56 ---> "1234,56" According to the documentation I've read, it isn't a bug: it's intentional. The "Underground PHP and Oracle Manual" describes the problem but it doesn't suggest any solution. Am I supposed to write a custom parser to convert numeric strings into floats and pray that the DBA will never change the locale settings? Is it enough to run... alter session set nls_territory=america nls_language=american ... when I open the (persistent) connection? (I still get strings but at least they're easy to cast.) |
#4
| |||
| |||
|
|
I'm playing with PHP and its oci8 extension and I'm facing a curious issue: numeric fields are returned as strings and, to make it worse, they're formatted using locale settings (well, sort of). For instance: 1234.56 ---> "1234,56" According to the documentation I've read, it isn't a bug: it's intentional. The "Underground PHP and Oracle Manual" describes the problem but it doesn't suggest any solution. Am I supposed to write a custom parser to convert numeric strings into floats and pray that the DBA will never change the locale settings? Is it enough to run... alter session set nls_territory=america nls_language=american ... when I open the (persistent) connection? (I still get strings but at least they're easy to cast.) |
#5
| |||
| |||
|
|
I'm playing with PHP and its oci8 extension and I'm facing a curious issue: numeric fields are returned as strings and, to make it worse, they're formatted using locale settings (well, sort of). For instance: 1234.56 ---> "1234,56" According to the documentation I've read, it isn't a bug: it's intentional. The "Underground PHP and Oracle Manual" describes the problem but it doesn't suggest any solution. Am I supposed to write a custom parser to convert numeric strings into floats and pray that the DBA will never change the locale settings? Is it enough to run... alter session set nls_territory=america nls_language=american ... when I open the (persistent) connection? (I still get strings but at least they're easy to cast.) |
![]() |
| Thread Tools | |
| Display Modes | |
| |