insert a multiline string in oracle with sqlplus using shell script
I have a two .err files which contains error log details.Here my requirement is for inserting the error log content into a custom error table.
I have prepared a shell script to store the error log details into custom error table.
Following is the script.
#!/bin/sh
export db_connection_url=apps/apps@VIS
for i in `ls *.err`
do
FILENAME=$i
v_output=`cat $i`
RETVAL=`sqlplus -s $db_connection_url <<EOF
SET SQLBLANKLINES ON;
SET SERVEROUTPUT ON;
insert into errlog_forms(v_filename,v_erroutput) values('$i','$v_output');
exit;
EOF`
done
Here i am able to inserting first .err file content into custom error table. I want to insert other one also.