Results 1 to 8 of 8
  1. #1
    Join Date
    Mar 2007
    Posts
    167

    Unanswered: isql output file...

    I'm currently using the below syntax to prevent the password being displayed via "ps".

    isql -Smyserver -Umylogin <<EOF
    $PASSWORD
    EOF

    The challange is... the isql output file for some reason contains the string "Password:". For example...

    -----------------------------------------------------------------------------------
    Password:
    The class column will display the cursor name for locks associated with a cursor for the current user and the cursor id for other users.
    fid spid loid locktype table_id page row dbname class context

    ------ ------ ----------- ---------------------------- ----------- ----------- ------ --------------- ------------------------------ ------------------
    ----------
    0 268 536 Sh_intent 688002451 0 0 master Non Cursor Lock

    (return status = 0)
    -----------------------------------------------------------------------------------

    How do I get rid of the "Password:"? Sorry if this is a basic question. I've tried everything I know, but have not been successful in getting rid of the "Password:" string in my isql output file.

    Thank you.

  2. #2
    Join Date
    Sep 2003
    Location
    Switzerland
    Posts
    443
    Use -Ppassword OR use -P`cat filename` in the command line.

  3. #3
    Join Date
    Mar 2007
    Posts
    167

    Will the password be displayed in "ps" if I use -P ?

    Will the password be displayed in "ps" if I use -P ? For example...

    isql -Smyserver -Umylogin <<EOF
    -P$PASSWORD
    EOF

  4. #4
    Join Date
    May 2005
    Location
    South Africa
    Posts
    1,365
    Provided Answers: 1
    isql -Smyserver -Umylogin -o my.log <<EOF >/dev/null
    $(cat ~/.myserver)
    select getdate()
    go
    EOF
    more my.log

    Can also use -i flag with <<EOF

    Using a file to store your password (in e.g. .myserver) allow you to change your password without having to update all your scripts.

  5. #5
    Join Date
    Mar 2007
    Posts
    167

    Will this work.... <<EOF -P$PASSWORD EOF

    Will the password be displayed in "ps" if I use -P ? For example...

    Below is the exact syntax we are using...

    isql -S $SERVERNAME -U $LOGINNAME -i $ISQL_INPUT_FILE -w 500 >> $ISQL_OUTPUT_FILE <<EOF
    $PASSWORD
    EOF

    Will the below syntax work? Without displaying the password via "ps"?

    Below is the exact syntax we are using...

    isql -S $SERVERNAME -U $LOGINNAME -i $ISQL_INPUT_FILE -w 500 >> $ISQL_OUTPUT_FILE <<EOF
    -P$PASSWORD
    EOF

  6. #6
    Join Date
    May 2005
    Location
    South Africa
    Posts
    1,365
    Provided Answers: 1
    Quote Originally Posted by ftmjr
    Will this work.... <<EOF -P$PASSWORD EOF
    No I don't thik so
    Last edited by pdreyer; 11-27-07 at 06:43.

  7. #7
    Join Date
    May 2005
    Location
    South Africa
    Posts
    1,365
    Provided Answers: 1
    This is the best I can come up with to append to output

    isql -S $SERVERNAME -U $LOGINNAME -i $ISQL_INPUT_FILE -w 500 <<EOF | tail +2 >> $ISQL_OUTPUT_FILE
    -P$PASSWORD
    EOF

  8. #8
    Join Date
    Mar 2007
    Posts
    167

    I will give it a spin...

    You were right. I tried the below and it did not work...

    isql -S $SERVERNAME -U $LOGINNAME -i $ISQL_INPUT_FILE -w 500 >> $ISQL_OUTPUT_FILE <<EOF
    -P$PASSWORD
    EOF

    So we will give your code a spin...

    isql -S $SERVERNAME -U $LOGINNAME -i $ISQL_INPUT_FILE -w 500 <<EOF | tail +2 >> $ISQL_OUTPUT_FILE
    -P$PASSWORD
    EOF

    Sincere thanks for your help.

Posting Permissions

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