if [ $returncode -eq 0 ]
then
query_msg=`$ISQL -S $USERNAME/$PASSWD@$SERVICENAME <<EOJ
set serveroutput on;
set heading off;
set feedback off;
set linesize 150;
declare
out_value varchar2(32767);
BEGIN
SELECT MESSAGE into out_value FROM RED.ERROR_LOG WHERE PROC = 'colour' and
to_char(to_date(DT,'DD-MON-YY')) = to_char(to_date(sysdate,'DD-MON-YY'));
dbms_output.put_line(out_value);
END;
/
EOJ`
echo $query_msg > $DATADIR/colour_DB.log
in that log im getting query result along junk values ? i am missing something while declaring variable in plsql block? Can some help me on this?
query result : -
+query_msg=$'declare\n*\nERROR at line 1:\nORA-01403: no data found\nORA-06512: at line 5'
+ echo declare 0 1 221.log 132.log 321.log 456.log --> these are the files in the server path(unwanted result).