One of those things I should have known about SQL*Plus

I've been using SQL*Plus for over ten years, and this morning I spent two minutes digging up how to do something I've known could be done for years but never spent the two minutes doing, ug.

Through the years, my SQL*Plus scripts that I've run on UNIX & LINUX I've wanted to be able to suppress the "SQL*Plus banner", if you've used SQL*Plus or plan on using it you'll see the banner here in this example:

$ ./getCTO.sh

SQL*Plus: Release 10.2.0.4.0 -
Production on Wed Jul 9 08:25:52 2008

Copyright (c) 1982, 2007, Oracle. All Rights Reserved.

Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0
Production With the Partitioning, OLAP and Data Mining

Disconnected from Oracle Database 10g Enterprise Edition
Release 10.2.0.4.0 - Production
With the Partitioning, OLAP and Data Mining

The value of CTO is:Alexander Travel


If i change my script at the command line to include the -silent switch when calling SQL*Plus, you'll notice that all the extra text is removed from my standard output to the screen.

$ ./getCTO.sh 424
The value of CTO is:Alexander Travel


It's just one of those things I knew existed, but never spent the two minutes figuring out (until this morning).

Until next time...Rich

Comments