I need to set up some SET options in Oracle SQLplus command line program each time I use it, such as SET HEADING OFF and the likes to beautify my results.
I found that I always have to input each line separately so Set different options and this is becoming annoying since I need to access it many times a day.
I found that there’s no way to separate different SET commands with semicolons because it doesn’t accept it:
SET HEADING OFF; SET LINESIZE 100;
returns an error
A solution could be adding them to a control script and create a shell alias, but I know control scripts execute and then exit and don’t return you control over the command line.
So, anybody knows another solution? Or am I missing something?
Put all your commands in a “.sql” file (for example “format.sql”) then execute them with the “@” command in Sql*plus (for example “@format”).
Note that it defaults to the “.sql” suffix when looking for the command file.
For example, if “format.sql” contains the commands “set linesize 100” and “set pagesize 0”: