Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Insert records using shell script

TelluriumDBAMar 17 2017 — edited Mar 17 2017

I am trying to insert records to a table using a shell script. but it doesn't work. can you please help me on this ?

#!/bin/bash

HOST=`hostname`

sqlplus / as sysdba << EOF > /dev/null

insert into bslogger.status (PKID, HostName, DBName, BackupType, StartTime, EndTime, Status, LastUpdatedTime)

values (status_seq.nextval, '$1', '$2', '$3', sysdate, '', '$4', sysdate);

commit;

EXIT

EOF

echo $ORACLE_HOME

I've just echoed ORACLE_HOME for debugging purposes and it returns the correct home.

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 14 2017
Added on Mar 17 2017
15 comments
4,222 views