alter session number format [message #486829] |
Mon, 20 December 2010 08:52  |
 |
alreadynight
Messages: 5 Registered: December 2010
|
Junior Member |
|
|
Hi,
anyone knows how to change the default format of a number value using alter session statement?
I've a problem when I show a value like this "0.123456": the select statement returns ".123456".
Is there any way to force a zero value before the character separator?
Thanks
|
|
|
|
|
|
|
|
|
|
Re: alter session number format [message #486840 is a reply to message #486835] |
Mon, 20 December 2010 10:35   |
 |
Michel Cadot
Messages: 68770 Registered: March 2007 Location: Saint-Maur, France, https...
|
Senior Member Account Moderator |
|
|
alreadynight wrote on Mon, 20 December 2010 16:37I make a query by PHP.
It's the same on sqldeveloper.
Thanks
From PHP you can display the number (which comes from Oracle or anything) as you want, it is just a matter of CLIENT program not Oracle.
Regards
Michel
[Updated on: Mon, 20 December 2010 10:35] Report message to a moderator
|
|
|
Re: alter session number format [message #486842 is a reply to message #486840] |
Mon, 20 December 2010 10:44   |
 |
Barbara Boehmer
Messages: 9106 Registered: November 2002 Location: California, USA
|
Senior Member |
|
|
As Michel said, this should be handled by the client, not the database, as it is how something is displayed, not how it is stored. There isn't any magical "alter session set ..." that will do this from Oracle. If SQL*Plus were your client, then you could do as shown below, using a SQL*Plus SET command. This is a SQL*Plus command, not an Oracle SQL or PL/SQL command. This will only affect how the data is displayed from SQL*Plus, not from other programs that access the database. There should be something similar in whatever you are using to display your data instead of SQL*Plus.
SCOTT@orcl_11gR2> select 0.123456 from dual
2 /
0.123456
--------
.123456
1 row selected.
SCOTT@orcl_11gR2> set numformat 0.999999
SCOTT@orcl_11gR2> select 0.123456 from dual
2 /
0.123456
---------
0.123456
1 row selected.
SCOTT@orcl_11gR2>
|
|
|
|
|