Results 1 to 2 of 2
  1. #1
    Join Date
    Dec 2005
    Posts
    1

    Unanswered: getting sql output value in unix shell script

    Please tell me how to get the sql output value from unix shell script.
    My sample shell script is as given below.

    A=00000
    sqlplus -s system/manager @test.sql $A > aaa

    My sample test.sql file is as given below.

    select count(*) from tab_name where sol_id = '&1' ;
    spool off
    exit


    Now I want to get the count(*) value from sql to unix shell script.

  2. #2
    Join Date
    Jun 2003
    Location
    West Palm Beach, FL
    Posts
    2,713

    Cool


    Try this:
    Code:
    A=$(sqlplus -s system/manager @test.sql $A)

    The person who says it can't 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
  •