If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Unix Shell Scripts > stored procedure problem

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-18-06, 09:27
bhaizone bhaizone is offline
Registered User
 
Join Date: Feb 2006
Posts: 31
stored procedure problem

I need to execute a shell script that in turn executes a stored procedure(eg. select * from temp) . Now I want to get the result of the stored procedure or the select statement output and store that result in a file. How to do this?

I am working in korn shell.
Reply With Quote
  #2 (permalink)  
Old 04-19-06, 02:08
pdreyer pdreyer is offline
Registered User
 
Join Date: May 2005
Location: South Africa
Posts: 1,268
Depending on the tool you use you might be able to specify a flag for input and output
e.g. isql -i infile -o outfile
else use shell redirect
e.g. isql <infile >outfile 2>&1
e.g. isql <<EOF >outfile 2>&1
select * from temp
go
EOF
Reply With Quote
  #3 (permalink)  
Old 04-21-06, 04:26
prashant_add prashant_add is offline
Registered User
 
Join Date: Mar 2006
Posts: 25
Unhappy

use these statements in ur script

isql -Uuser_name -Ppassword<<!RUN>>outputfile_name
select * from temp
go
!RUN

after this execute the script
as
sh filename

Quote:
Originally Posted by bhaizone
I need to execute a shell script that in turn executes a stored procedure(eg. select * from temp) . Now I want to get the result of the stored procedure or the select statement output and store that result in a file. How to do this?

I am working in korn shell.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On