SQL*Plus (MOSC)

MOSC Banner

insert a multiline string in oracle with sqlplus using shell script

edited Apr 17, 2013 6:20AM in SQL*Plus (MOSC) 2 commentsAnswered
Hi,

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.

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center