Results 1 to 4 of 4
  1. #1
    Join Date
    Jul 2007
    Posts
    13

    Unanswered: Passing unix commands in a select statment

    I have a unix value i want to parse to oracle...I need to know how to do that when I'm already login in sqlplus.
    for example, I want to pass the `tput cols` value into set linesize x
    additional such unix output parsed to sql would be use full while logged in sqlplus

  2. #2
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    Code:
    cat tester.sh
    linesize=`tput cols`
    echo $linesize
    sqlplus << EOF
    / as sysdba
    set term on echo on
    set linesize $linesize
    exit
    EOF
    This questions has NOTHING to do with Oracle & is just shell script basics.
    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
    Jul 2007
    Posts
    13
    Quote Originally Posted by anacedent
    Code:
    cat tester.sh
    linesize=`tput cols`
    echo $linesize
    sqlplus << EOF
    / as sysdba
    set term on echo on
    set linesize $linesize
    exit
    EOF
    This questions has NOTHING to do with Oracle & is just shell script basics.
    If you looked at my example, I'm already logged in sqlplus and I want to parse Unix values into a sqlscript or variable. I already know how to parse a unix variable into a shell script. is there a way to do this while I'm in sqlplus. or inside a sqlscript instead.

  4. #4
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    You need to be smarter than the tools you are (ab)using.

    host echo "set linesize `tput cols`" > /tmp/setlines.sql
    @/tmp/setlines.sql
    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.

Posting Permissions

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