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


Please Help Members By Posting Answers For Below Questions

What does sh mean?

619


How to find duplicate record in file using shell script?

850


What is option in shell script?

561


how to print the 2-d, 3-d arrays in unix shell script programs please answer thi questio to my mail venusaikumar@gmail.com

2107


What is the syntax of "nested if statement" in shell scripting?

631






How do I set bash as default shell mac?

559


What are the different commands available to check the disk usage?

495


Write a script to print the first 10 elements of fibonacci series.

1768


Why should we use shell scripts?

592


What does $@ mean bash?

669


Set up a Sev 2 alert when the Primary WA service fails. A windows batch script needs to be created that will monitor the WA service on the Primary and when the service stops/fails a Sev 2 TT is generated for a particular team ?

1716


What are zombie processes?

571


What are the various stages of a linux process it passes through?

627


How do we create command aliases in a shell?

542


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.

1856