Results 1 to 3 of 3
  1. #1
    Join Date
    Jun 2011
    Posts
    5

    Unanswered: how to pass variable to sybase script

    Hi,

    I like to write a simple query, but just can't pass to sybase query


    #!/bin/ksh
    export key1=$1
    isql -Umy_id -Smy_DB -Pmy_passwd << EOF
    select * from my_table
    where id like "%key1%"
    go
    exit
    EOF


    but it just does not return anything.

  2. #2
    Join Date
    May 2011
    Posts
    28

    how to pass variable to sybase script

    Hi,
    Write the query in a sql file.
    Then replace the variable in sql file using sed command.
    Now run the sql file
    isql -Umy_id -Smy_DB -Pmy_passwd -i<sql file> -o<Output file>

  3. #3
    Join Date
    Jun 2011
    Posts
    5
    I figure out what the problem is....as I just "modified" from a script
    i put the -o option, hence it sends to a file

Posting Permissions

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