SQL in CSH script

How can incorporate some sql commands in a .csh file.
for example I want to run sqlplus and the desc a table.
thanks,
m3
m3Asked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
ahoffmannConnect With a Mentor Commented:
#! /bin/csh -f -b

echo "descr table;"  > /tmp/sql.cmd
echo "exit;"            >> /tmp/sql.cmd
sqlplus -s user/passwd @/tmp/sql.cmd
rm  /tmp/sql.cmd
0
 
m3Author Commented:
Could you explain what are the options -f -b for the cshell and -s for sqlplus? Thanks.
0
 
ahoffmannCommented:
man csh sqlplus  ;-)

          [-s[ilent]]
          Suppress all SQL*Plus information and prompt messages.

         [ -f]
         Starts without searching for or running commands from the
        .cshrc file in your home directory.

         [-b]
         End of option passed to csh itself. Allows passing options to
         the shell script itself (like -f or -c).
0
All Courses

From novice to tech pro — start learning today.