Solved

SQL in CSH script

Posted on 1999-01-26
3
352 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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

Suggested Solutions

Let’s list some of the technologies that enable smooth teleworking. 
In this article, I am going to show you how to simulate a multi-site Lab environment on a single Hyper-V host. I use this method successfully in my own lab to simulate three fully routed global AD Sites on a Windows 10 Hyper-V host.
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…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

816 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now