DBAsupport.com Forums - Powered by vBulletin
Results 1 to 2 of 2

Thread: Passing parameters to sql inside a shell script.

Threaded View

  1. #2
    Join Date
    Jul 2002
    Location
    Lake Worth, FL
    Posts
    1,492

    Cool

    What errors do you get?

    For one, your sqlplus query has syntax errors.

    Related to the parameters, you should not use double and single quotes.
    Also if you wish to execute a query, use '@' instead of '<' in the command line, try this:
    PHP Code:
    ret=`sqlplus -s $db_user/$db_pwd@$db_sid "$a" "$b" "$c" @./${DirectoryName}/Query.sql <<EOF
    -- here go your additional sql commands --
    exit
    EOF

    Last edited by LKBrwn_DBA; 03-27-2012 at 03:57 PM.
    "The person who says it cannot be done should not interrupt the person doing it." --Chinese Proverb

Posting Permissions

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


Click Here to Expand Forum to Full Width