Results 1 to 3 of 3
  1. #1
    Join Date
    Aug 2004
    Posts
    2

    Unanswered: Returning result of a SQL statement into Korn Shell variable without spooling...

    I'm looking for a sample code that returns reult from a SQL query to Korn Shell variable without spooling SQLPLUS output to a text as a first step.

    Thanks.

  2. #2
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    A shovel is a great tool for creating a hole in the ground, but only when the "correct" end of the shovel comes into contact with the Earth.
    IMO, you are trying to use the wrong "end" of the computer..
    OR
    When the only tool you have is a hammer, all problems are viewed as nails.
    A hammer is NOT the best choice of tools for making a piece of lumber shorter.

    I KNOW that PERL would be be a MUCH better tool for interoperating with both the OS & Oracle DB.

    HTH & YMMV

    P.S.
    While I suspect that I could do what you want,
    it is not worth the effort to make it happen.
    EXTERNAL PROCEDURES or JAVA are ways for the DB to diddle with the OS.
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

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

    Wink

    Try this:
    Code:
    var=`sqlplus -s / <<!EOF
    set echo off term off feed off ver off pages 0
    select sysdate from dual;
    exit
    !
    `

    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
  •