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 path in shell script?
What is shell application?
Calculate a real number calculation directly from the terminal and not any shell script.
What are the two files of crontab command?
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 is shell variable?
What is sh in shell script?
what is info area how many types?
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.
Is powershell a language?
What is eval in shell script?
What is batch file programming?
What are the different types of shell scripting?
Write down the syntax of "for " loop
Rewrite the command to print the sentence and convert the variable to plural: echo “i like $variable”.