Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2004
    Posts
    1

    Unanswered: batch to run stored_proc

    I'd like to run a batch to run a stored proc in sybase12.
    What's the command to automate the execution of the stored proc?
    I tried
    isql -S dsquery -U user -P password
    but that puts me into the isql mode (can't automate) plz help.
    Thanks.
    cary

  2. #2
    Join Date
    Oct 2003
    Location
    Netherlands
    Posts
    1

    Re: batch to run stored_proc

    Originally posted by Cary530
    I'd like to run a batch to run a stored proc in sybase12.
    What's the command to automate the execution of the stored proc?
    I tried
    isql -S dsquery -U user -P password
    but that puts me into the isql mode (can't automate) plz help.
    Thanks.
    cary
    Cary,

    Create file.sql containing

    use <Database>
    go

    exec <stored procedure>
    go

    Then create a batch file containing

    isql -S dsquery -U user -P password -i file.sql -o file.log

    Logging isql will appear in file.log

    Kind regards,
    Sjaak

  3. #3
    Join Date
    Nov 2002
    Location
    Switzerland
    Posts
    524
    Or, under Unix:

    Code:
    isql -Usa -P xxx -S Server -D Databasename -o output.txt << EOF
    exec <stored procedure>
    go
    EOF

Posting Permissions

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