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 / vikas
U can use .
Database coumns are : Emp.No, Emp. Name, Salary, Dept.No.
$ cut -f 1,3 <filename> > temp.txt
This will print two columns: emp/ No and salarya and store
it in fiile temp.txt in same directory.
If u want to sort them:
$ cut -f 1,3 <filename> > temp.txt
$ sort -otemp.txt temp.txt
| Is This Answer Correct ? | 5 Yes | 9 No |
Post New Answer View All Answers
What are the zombie processes?
What is in a script?
What is option in shell script?
how will you find the total disk space used by a specific user?
What is the lifespan of a variable inside a shell script?
What does $@ mean bash?
What is $1 in shell scripting?
Print a given number, in reverse order using a shell script such that the input is provided using command line argument only.
I want to monitor a continuously updating log file, what command can be used to most efficiently achieve this?
how to get part of string variable with echo command only?
What is shell application?
What is an inode block?
What is batch file programming?
What is scripting used for?
What is the difference between bash and shell?