how do i know sql command is executed or not in unix?
i want to insert new record based on if below record inserted into table.how do i know query is executed or not? please look the below query for reference in unix.
sqlplus -s bscsadm@bscspr/bs#s7Ta0m << EOF insert into $1 values('ram',222,'hyd'); EOF |
"Unix" is not executingthat SQL query, the sqlplus executable is.
Most commands return a non-zero exit code if an error condition occurred. Try checking the $? variable immediately after running sqlplus. |
Moderator Response
Moved: This thread is more suitable in <Other *NIX> and has been moved accordingly to help your thread/question get the exposure it deserves.
|
Quote:
Code:
// harmful shell statement removed. |
Please, ignore the post above. It will be deleted soon.
|
You may have problems with your statement depending on if sqlplus will auto commit your transaction when you exit. I think the default behavior is to rollback any changes. You would likely have to add a commit; after your insert statement.
I'd be best to capture an error condition in your script and set the exit code when your script terminates. Search around for sqlplus exit code. |
All times are GMT -5. The time now is 11:05 AM. |