Results 1 to 4 of 4
  1. #1
    Join Date
    Oct 2003
    Location
    UK
    Posts
    9

    Unanswered: Scripts and Databases

    Hi,

    I want to write a Unix script to prompt the user for inputs, then perform two SQL routines (check one of the inputs is valid against a database, then batch update the DB incorporating the inputs).

    I am pretty new to Unix scripting so only have experience of getting inputs and manipulating strings. I have no idea on how to query and update databases from the scripts, so any help would be appreciated (eg. starting points or tutorials etc)

    Thanks.

  2. #2
    Join Date
    May 2003
    Location
    France
    Posts
    112

    Re: Scripts and Databases

    Here's a beginning for your script, hope this will help you.


    echo "My Question ?\c"
    read response

    sql_response=`sqlplus -s $ORACLE_LOGIN/$ORACLE_PWD@$ORACLE_ALIAS @my_batch.sql $response`

    if [ "$sql_response" = ....

    Originally posted by sweevo
    Hi,

    I want to write a Unix script to prompt the user for inputs, then perform two SQL routines (check one of the inputs is valid against a database, then batch update the DB incorporating the inputs).

    I am pretty new to Unix scripting so only have experience of getting inputs and manipulating strings. I have no idea on how to query and update databases from the scripts, so any help would be appreciated (eg. starting points or tutorials etc)

    Thanks.

  3. #3
    Join Date
    Oct 2003
    Location
    UK
    Posts
    9
    Hi,

    Thanks for that - though sorry, I should have said it's an Ingres DB I'm working with. Are the fundamentals the same?

    Cheers

  4. #4
    Join Date
    May 2003
    Location
    France
    Posts
    112
    Hi,
    i do no know ingres db but i think the fondamentals are the same;
    be careful of the output of "sqlplus" to store correctly the result in the variable sql-response


    Originally posted by sweevo
    Hi,

    Thanks for that - though sorry, I should have said it's an Ingres DB I'm working with. Are the fundamentals the same?

    Cheers

Posting Permissions

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