Link to home
Start Free TrialLog in
Avatar of booksplus
booksplus

asked on

Sqlplus - saving environment options from session to session

I want to be able to set the linesize and set the wordwrap and then have the settings saved from session to session.

When I set the environment options, the setting reverts back after I close SQLPLUS and open a new SQLPLUS window.

How do I save my settings from session to session.  OR how do I open the SQLPLUS with my preferred options (command line options?).

Thanks.
Avatar of slightwv (䄆 Netminder)
slightwv (䄆 Netminder)

Place these in either your login.sql or glogin.sql file.

They will be active each time you log in.  The only gotcha is that depending on your O/S, you may have to execute your login.sql file each time you connect as another user in the same sqlplus session.
ASKER CERTIFIED SOLUTION
Avatar of paquicuba
paquicuba
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Target should look like: C:\oracle\ora92\bin\sqlplus.exe <your_user_id>/<your_password>@<database> @commands.txt
Hope this helps!
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of booksplus

ASKER

How do I enter the commands in the file -
I want linesize to be 130 and word wrap turned off.

exactly as you would enter it from the 'SQL>' prompt.  Place each entry on its own line.

i.e./

contents of login.sql
============================
set lines 130
set pages 100
...

SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial