In shell script I am inserting the record in to the table.After excuation the script output is commit complete which is fine but I need my echo should be display like "Account created"
#!/bin/ksh
.
.
.
inst dev000
sqlplus -s username/password EOF
Insert into table (column1,column2,column3) values ($gblid,$sysid,$crdate);
commit;
exit
EOF
=============================
Script Output #1:
commit complete.
Instead of above line o/p should be "Account created".
How I can do this?
============================
============================
Script Output#2:
ORA-00001: unique constraint violated
If output is like this then o/p should be "Account can't created"
How I can do this?
============================
How I can trap oracle error?
#!/bin/ksh
.
.
.
inst dev000
sqlplus -s username/password EOF
Insert into table (column1,column2,column3) values ($gblid,$sysid,$crdate);
commit;
exit
EOF
=============================
Script Output #1:
commit complete.
Instead of above line o/p should be "Account created".
How I can do this?
============================
============================
Script Output#2:
ORA-00001: unique constraint violated
If output is like this then o/p should be "Account can't created"
How I can do this?
============================
How I can trap oracle error?