Home » Infrastructure » Unix » How to pass sql result set to unix shell script variable
How to pass sql result set to unix shell script variable [message #97691] Thu, 14 November 2002 12:32 Go to next message
Shelley
Messages: 2
Registered: November 2002
Junior Member
I am trying to run a sql ( that returns a count(*) )through a script in shell . And I want to pass the count(*) value of that sql to a variable in the shell script. How can I achieve it?

Thanks
-H
Re: How to pass sql result set to unix shell script variable [message #97696 is a reply to message #97691] Fri, 15 November 2002 14:12 Go to previous messageGo to next message
andrew again
Messages: 2577
Registered: March 2000
Senior Member
see this URL

Re: How to pass sql result set to unix shell script variable [message #98544 is a reply to message #97691] Thu, 23 December 2004 23:05 Go to previous message
vijayalakshmi
Messages: 4
Registered: February 2004
Junior Member
I am trying to run a sql ( that returns a count(*) )through a script in shell . And I want to pass the count(*) value of that sql to a variable in the shell script. How can I achieve it?

Answer : Put Set head off in the script. Get the output of the sql query in a file and truncate all the spaces in the file , now the file will only have the count of records, which you can use it set in a variable
Previous Topic: oracle errors
Next Topic: ORA-24370
Goto Forum:
  


Current Time: Fri Nov 22 15:45:10 CST 2024