Simpler Navigation for Servers and Operating Systems - Please Update Your Bookmarks
Completed: a much simpler Servers and Operating Systems section of the Community. We combined many of the older boards, so you won't have to click through so many levels to get at the information you need. Check the consolidated boards here as many sub-forums are now single boards.
If you have bookmarked forums or discussion boards in Servers and Operating Systems, we suggest you check and update them as needed.
General
cancel
Showing results for 
Search instead for 
Did you mean: 

HOWTO format sql queries without having to use format all the time ??

Henrique Silva_3
Regular Advisor

HOWTO format sql queries without having to use format all the time ??


OK, not the end of the world, but pretty anoying to me !!!

I have this OID on tons of tables on this DB that is declared as number(18)

When bringing up sqlplus, trying to quickly look at this numbers, to do some troubleshooting, or checking things out, If I list these columns, I get :

OID1 OID2 OID3
2.34+14 2.34+14 2.34+14

these values are all different,but because they are sequential in nature, I can not quickly tell them apart, but by using the

column OID1 format 9999999999999999

Is there a quick way to make sqlplus display the whole value without going to this exercise everytime ?

Thanks,

Henrique
"to be or not to be, what was the question ???? "
4 REPLIES
Stan_17
Valued Contributor

Re: HOWTO format sql queries without having to use format all the time ??

Hi Henrique,

try to set all your common columns format in glogin.sql. always, sqlplus reads this file before it brings up the sql prompt. more or less like .profile.

hth,
Stan
twang
Honored Contributor

Re: HOWTO format sql queries without having to use format all the time ??

You can
- use a script to save the sqlplus parameter settings:
set termout off
store set sqlplus_settings replace
clear breaks
clear columns
clear computes
set feedback off
set verify off
set termout on
set define "&"

- use a script to make changes of all the required format settings

- use another script to restore these parameter settings in cases where they need to be temporarily changed:
set termout off
@sqlplus_settings
clear breaks
clear columns
clear computes
set termout on



Yogeeraj_1
Honored Contributor

Re: HOWTO format sql queries without having to use format all the time ??

hi,

you may wish to create a file called login.sql in your home directory and put the following lines in it:
column OID1 format 9999999999999999


hope this helps!

regards
Yogeeraj
No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)
T G Manikandan
Honored Contributor

Re: HOWTO format sql queries without having to use format all the time ??

you can either use

$ORACLE_HOME/sqlplus/admin/glogin.sql for Global settings for SQL

login.sql placed at home dir of the user which is user profile for SQL

First the glogin .sql is read and then the login.sql

Thanks