KSH script error trapping
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
0