Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2006
    Posts
    31

    Unanswered: 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.

  2. #2
    Join Date
    May 2005
    Location
    South Africa
    Posts
    1,365
    Provided Answers: 1
    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

  3. #3
    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •