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
c program to implement unix/linux command to block the signal ctrl-c and ctrl-\ signal during the execution ls -l|wc -l
What are the advantages of shell script?
What is the syntax of "nested if statement" in shell scripting?
What is bash shell command?
What is batch file programming?
What are zombie processes?
What is echo in shell?
What are the two files of crontab command?
Write the syntax for "if" conditionals in linux?
How can you find out how long the system has been running?
What are the different communication commands available in the shell?
What is shell scripting used for?
Devise a script that takes file name as arguement(which must present in the current directory)and locates from your home directory tree all thpath names of its links.Then mail the list to self.
What does $1 mean in bash?
What language is shell scripting?