Pass variable from Shell script to plsql block
781163Jan 13 2012 — edited Apr 23 2012Hi,
I am having a shell script and having to pass parameter from Shell script into a PLSQL block, I am using the below code but unable to fetch any result,
Can anyone help me sort this out??
Shell Script: test.sh
*#!/bin/sh*
var1=$1
SQLPLUS="sqlplus -s"
LOGON="gmisowner/gmisowner1"
day=`$SQLPLUS $LOGON <<++
set heading off
set feedback off
begin
select count() from mis_ref_codes where ref_description=&var1;*
end;
exit;
++`
echo $day
Execution at command prompt: > ./test.sh Underline
does not return anything
1. I was hoping the count(*) of the number of rows from the select statement will be stored in day, but nothing returns as an output from the plsql block
the above select statement is a sample but I am having to run a much bigger plsql block
Am I doing something wrong syntactically here? please suggest
Edited by: Hemz on Jan 14, 2012 12:35 AM