Below script works perfectly fine from command line, but when I run through browser I am not getting anything inside my $dt. Because of this its always going inside failure scenario. My procedure is going to return either Success / Failed output. Can anybody tell me where I am messing up.
Code: ( text )
#!/usr/bin/ksh
if [ $REQUEST_METHOD == "POST" ]
then
QUERY_STRING=`line <&0`
fi
export TEMP_STRING=$QUERY_STRING
User_ID=`echo $TEMP_STRING | awk 'BEGIN {FS="&"} { for (i=1; i<=NF; i++) {if($i ~ /userid/) {print $i;} } }' | cut -f2 -d'='`
SCRN_Token=`echo $TEMP_STRING | awk 'BEGIN {FS="&"} { for (i=1; i<=NF; i++) { if($i ~ /scrntoken/) {print $i;} } }' | cut -f2 -d'='`
SQLPLUS=`which sqlplus`
FMUSER=username
FMPASS=password
FMSID=orasid
REMOTE_ADDR=`env | grep "REMOTE_ADDR" | cut -f2 -d'='`
NewToken="${REMOTE_ADDR}${User_ID}"
dt=`$SQLPLUS -s $FMUSER/$FMPASS@$FMSID <<EOF
set head off
set pagesize 0
set feedback off
set serveroutput on feedback off
exec validate_fm_user('$SCRN_Token', '$NewToken')
quit
EOF`
echo dt is -$dt-
if [ "$dt" != "Success" ]
then
#some error action
exit 0
fi