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
Explain about gui scripting?
What is the significance of $#?
What is in a script?
What happens when you type ls?
How to write a function?
Write a shell script that adds two numbers if provided as the command line argument and if the two numbers are not entered throws an error message.
Write down the syntax of "for " loop
I want to create a directory such that anyone in the group can create a file and access any person's file in it but none should be able to delete a file other than the one created by himself.
What is the best scripting language?
What does it mean to debug a script?
What are the various stages of a linux process it passes through?
What is the use of "$?" Sign in shell script?
Why is a script important?
What will happen to my current process when I execute a command using exec?
What are the four fundamental components of every file system on linux?