setting a SQLPLUS variable to a shell variable
DBAsupport.com Forums - Powered by vBulletin
Results 1 to 2 of 2

Thread: setting a SQLPLUS variable to a shell variable

  1. #1
    Join Date
    Mar 2000
    Location
    woodbridge,nj,USA
    Posts
    14
    DBA's

    Is there a way to set a unix shell variables to sqlplus
    variables.

    The following sql called in a shell sript
    and I want to capture the output variables err_num and err_mesg into shell script variables:


    #!/bin/ksh
    filename='test.txt'
    err_num=''
    err_mesg=''

    sqlplus -s scott/tiger@orcl < var serr_num varchar2(10);
    var serr_mesg varchar2(20);
    set serveroutput on;
    exec extr_dps_orders('$filename',:serr_num,:serr_mesg);
    exit;
    EOF
    exit
    EOF
    ?? how do I set err_num and err_meg

    Thanks
    Umesh

  2. #2
    Join Date
    Jun 2000
    Location
    Madrid, Spain
    Posts
    7,447
    well you cant really with SQL, with PL/SQL is possible but not with sql

    check

    http://www.dbasupport.com/forums/sho...threadid=18167

Posting Permissions

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


Click Here to Expand Forum to Full Width