how do you write sql queries using shell script
for eg:- we have databae table like EMPNO,ENAME,SAL,DEPTNO
columns in EMP table how you display EMPNO,SAL FIELDS from emp
in SHELL SCRIPT please explain with an example
Answer Posted / alpkumar
Do you mean something like this .. how do you use queries
in conjunction with shell scripts..If so, usually the
general practice which goes on is that -- write a query on
what ever database you are working with with the relevant
sql syntax.. call this query from the shell script.
For this, in our program we should start using the commands
that the database company will be providing to use in unix
environement.. So use these unix commands for connecting to
the database, calling the specific query which we had
created..,.etc ...So look out for the commands which will
be available from database provider..to use in unix/linux
flavours and accomplish your script to perform the action
automating in generating reports and mailing them (or what
ever you wanna do.. )
Is This Answer Correct ? | 6 Yes | 9 No |
Post New Answer View All Answers
Why is a script important?
Hello all, This is my assignment on shell scripting, can anyone help me regarding this ? Create a shell script which connects to the database In second shell script include the first script for the DB connection Create a table (PRADEEP_DATA) with 2 columns (name, value) In Third shell script include the first script for the DB connection And insert/delete the values from the Table, by accepting input from the user This functionality should be a menu driven Program: 1) Insert to the database a. Name b. value 2)Delete from the database a.Name b.value Exception handling needs to be taken care.
write a shell script to check the failed jobs?
What is a beat in a script?
Is shell scripting a programming language?
What is the first line in every perl script called?
What is the default shell of solaris?
Is shell a part of kernel?
Which scripting language is best for automation?
How will you connect to a database server from linux?
What is difference between bash and shell?
What are zombie processes?
How do I open a jshell in cmd?
What is the difference between scripting and coding?
What language is used in terminal?