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 is console line?
Print a given number, in reverse order using a shell script such that the input is provided using command line argument only.
Why is shell scripting important?
What does $0 mean in shell script?
shell script for reverse the string
what is tickets $ what low,medium,high priorite pls define time also
What is awk in shell script?
What is a boot block?
What makes c shell a more preferable option than the bourne shell?
What is bash eval?
What is an sh file?
What is sh in shell script?
What's the difference between scripting and coding?
What is the use of "$#" in shell scripting?
Explain about non-login shell files?