Saturday, October 4, 2008

View and Modify SQL* Plus system variables

There are variables which control the behavior of SQL* PLUS. We can view these variables by SHOW command. ALL is used to view all the system variables. Thus to view all the SQL* PLUS system variable type:

SQL> SHOW ALL

To view the value for a single system variable use:

SHOW [Variable Name]

Example:
SQL> SHOW SUFFIX
suffix “sql”

How to change the default file extension in SQL*PLUS

The variable SUFFIX displays the default extension of the file created/edited or saved through SQL* PLUS. To set a system variable use SET command like
SQL> SET SUFFIX txt

Thus the default extension of files for the current SQL* PLUS session is set as txt. Thus when we use SAVE command followed by a file name without providing an extension file will be created as “.txt” file. Change in the system variable will be applicable only for the current session.
SQL> SHOW SUFFIX
suffix “txt

1 comment:

  1. Hi Prakash, is it possible to use backspace to delete char in sqlplus? what is the best sql editor (open source)? plz update. Thank you :)

    ReplyDelete

 
web counter
Download a free hit counter here.