Re: How to print column heading only in SQL plus

From: Mladen Gogala <gogala.mladen_at_gmail.com>
Date: Fri, 13 Sep 2013 23:45:05 +0000 (UTC)
Message-ID: <pan.2013.09.13.23.45.05_at_gmail.com>


On Fri, 13 Sep 2013 21:08:29 +0100, Eric wrote:

> You can be _very_ arcane in SQL*Plus itself (see Tanel Poder's Snapper),
> but I don't see why a shell script needs to be arcane, there are three
> basic was to call SQL*Plus from a shell:
>
> . sqlplus x/y_at_db1 @myscript.sql
>
> . sqlplus x/y_at_db1 <<HEREDOC
>
> . print "script stuff" | sqlplus x/y_at_db1
>
> Because you can replace the print by anything at all as long as it
> generates a script, that one can possibly get a bit arcane, but almost
> all the time there is no need to.

I am sorry, but this doesn't pass my aesthetic muster. I much prefer doing programming tasks by using a programming language, like Perl or PHP. It is not only prettier, it's more efficient, too. Shell is meant for interacting with OS, not for interacting with Oracle. There are other databases which have tools to deal with shell scripts, primarily db2, but with Oracle, I am resorting to Perl whenever possible.

-- 
Mladen Gogala
The Oracle Whisperer
http://mgogala.byethost5.com
Received on Sat Sep 14 2013 - 01:45:05 CEST

Original text of this message