Solved

SQL in CSH script

Posted on 1999-01-26
3
356 Views
Last Modified: 2013-12-23
How can incorporate some sql commands in a .csh file.
for example I want to run sqlplus and the desc a table.
thanks,
m3
0
Comment
Question by:m3
  • 2
3 Comments
 
LVL 51

Accepted Solution

by:
ahoffmann earned 50 total points
ID: 1583285
#! /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
 

Author Comment

by:m3
ID: 1583286
Could you explain what are the options -f -b for the cshell and -s for sqlplus? Thanks.
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 1583287
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

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Short answer to this question: there is no effective WiFi manager in iOS devices as seen in Windows WiFi or Macbook OSx WiFi management, but this article will try and provide some amicable solutions to better suite your needs.
Data center, now-a-days, is referred as the home of all the advanced technologies. In-fact, most of the businesses are now establishing their entire organizational structure around the IT capabilities.
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

829 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question