Database Administration (MOSC)

MOSC Banner

KSH script error trapping

edited Jul 3, 2013 11:28AM in Database Administration (MOSC) 5 commentsAnswered ✓
I have a ksh script that inserts data into a table in Oracle database. The table has a primary key created on three columns. I need to trap an error in case that constraint is violated and causes an error. How can I do error trapping within my ksh script?

Here is my code:

sqlplus 'username/pwd@MYDB' << EOF > $FILE1
                        $sql
                        commit;
                        exit;
EOF

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