Re: Is SQL*Plus a must...*really*?

From: <jl34778_at_corp02.d51.lilly.com>
Date: 19 May 94 19:26:29 EST
Message-ID: <1994May19.192629.1_at_corp02.d51.lilly.com>


You could use SQL*DBA to have SQL generate SQL, although it wouldn't be pretty, because you can't turn of headings, etc.. You would still have to edit the spooled file.

You can run DESCRIBE from SQL*DBA.

In addition to the ad-hoc capabilities of SQL*PLUS mentioned by others, I find it useful because:

  • it has a command editor. If you mistype in SQL*DBA, get used to re-typing the entire command.
  • it has substitution variables. This allows you to write generic scripts that accept parameters. You can even pass those parameters to anonymous PL/SQL blocks.
  • The SQL*Plus COPY command, along with SET COPYCOMMIT and SET ARRAYSIZE, allows you to use a single command to copy large amounts of data around, but easily break the copy into small units of work (do an occasional COMMIT)
  • You can do some pretty cool stuff with the SET and COLUMN commands. For example, suppose you wanted to create a spool file that was named based on the database name (in ORACLE7). If you ran the following script in the DEV database, it would create a file called DEV.INFO that held the output from the V$DATABASE table.
	col database_name new_value database_name noprint
	select name database_name from v$database;
	spool &database_name..info
	select * from v$database;
	spool off
----
Bob Swisshelm                | swisshelm_at_Lilly.com     | 317 276 5472
Eli Lilly and Company        | Lilly Corporate Center  | Indianapolis, IN 46285
Received on Fri May 20 1994 - 02:26:29 CEST

Original text of this message