Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2006
    Posts
    6

    Unanswered: Running a batch file through ISQL?

    Hi I have a big update. I have a few hundred like the following:

    update personnel set email_address = 'xxxxx@xxxx.com',email_method = 'MSMAIL' where personnel_id = 'xxxxx'
    update personnel set email_address = 'xxxxx@xxxx.com',email_method = 'MSMAIL' where personnel_id = 'xxxxx'
    update personnel set email_address = 'xxxxx@xxxx.com',email_method = 'MSMAIL' where personnel_id = 'xxxx'

    Now in the isql command prompt I can run each one only after inputting "go". How can I incorporate "go" in this file. Also how would I run the file from the ISQL command prompt. Sorry but a little new to Sybase.

  2. #2
    Join Date
    Jan 2006
    Posts
    6
    Well answered my own question. I'll post what I did here in case someone more of a newb than me comes looking for the answer. I dont think there is someone more of newb .

    So create a file, with these lines or whatever your sql statements are:

    update personnel set email_address = 'xxxxx@xxxx.com',email_method = 'MSMAIL' where personnel_id = 'xxxxx'
    update personnel set email_address = 'xxxxx@xxxx.com',email_method = 'MSMAIL' where personnel_id = 'xxxxx'
    update personnel set email_address = 'xxxxx@xxxx.com',email_method = 'MSMAIL' where personnel_id = 'xxxx'
    update personnel set email_address = 'xxxxx@xxxx.com',email_method = 'MSMAIL' where personnel_id = 'xxxxx'
    update personnel set email_address = 'xxxxx@xxxx.com',email_method = 'MSMAIL' where personnel_id = 'xxxxx'
    update personnel set email_address = 'xxxxx@xxxx.com',email_method = 'MSMAIL' where personnel_id = 'xxxx'
    go


    Just one "go" at the end of all statements. No semicolons at the end of each statement. Name the file as you wish and run the command as such.

    C:\>isql -Uusername -Sdbname -Ppassword -i sybasebat.txt -e -o sybasebat.out

    Hope that helps somewhat.

Posting Permissions

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