0

I am trying to use the value of 'P' in the second SQL procedure however it doesnt take the value. Please suggest.

P=`sqlplus -s $OraInfo <<!EOF
   SET ECHO ON
   SET SERVEROUTPUT ON SIZE 1000000
   SET LINE 900
   SET WRAP ON
   SET HEADING OFF
   SET TRIMOUT ON
   SET TRIMSPOOL ON
   select i_rea_enrl from NTA_ENRL WHERE I_ENRL_ASG='$f2';  
    print 
    exit;
!EOF`

echo $P >> $LOG_FILE

Q=\'$ShellName\'
`sqlplus -s $OraInfo <<-! >> $LOG_FILE
    SET ECHO ON
    SET SERVEROUTPUT ON SIZE 1000000
    SET LINE 900;
    SET WRAP ON;
    exec STAPROC.STA_NTA_ENRL_PP7_PKG.ADD_TO_STAGE($P,'PP7','$f2');
    print
    exit;
!EOF`
2
  • 1
    The second here document is incomplete — the command is not executed. You use <<-! to start the here document, but you have !EOF where you wanted an end marker. Make the start and end markers consistent. I suggest deleting the question since you have a simple typo which no-one else will benefit from. Commented Sep 8, 2020 at 5:29
  • Does this answer your question? how to pass variable from shell script to sqlplus Commented Sep 8, 2020 at 6:40

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.