Oracle Setting Up a Globalization Support Environment

╄→尐↘猪︶ㄣ 提交于 2019-12-11 10:43:20

问题


We want to set this SET NUMFORMAT 99999999999999999.00 at the user/schema level, for all sessions. Currently ,when set this command , it is getting applicable for that session only. Can we do this globally , so that when ever we open the connection , this works >


回答1:


SET NUMFORMAT is a SQL*Plus command. In general, it is a client-side setting to display the number.

You could always store the SQL*Plus settings in login.sql and glogin.sql. Whenever SQL*Plus starts up, it looks for a file named glogin.sql under the directory $ORACLE_HOME/sqlplus/admin. If such a file is found, it is read and the containing statements are executed. Additionally, after reading glogin.sql, sql*plus also looks for a file named login.sql in the directory from where SQL*Plus was and in the directory that the environment variable SQLPATH points to and reads it and executes it. Settings from the login.sql take precedence over settings from glogin.sql.

If you are just displaying the number, and want it to be displayed in desired format, then use TO_CHAR at individual SQL statement level.

For example,

SQL> select to_char(123.456,'999.9') VALUE from dual
  2  /

VALUE
------
 123.5

Bottomline, 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.



来源:https://stackoverflow.com/questions/35126882/oracle-setting-up-a-globalization-support-environment

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!