![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Korn Shell Script to find out error in logfile | jithu | Shell Programming and Scripting | 2 | 04-24-2008 02:12 PM |
| Handling Errors in Shell Scripts | sarsani | UNIX for Dummies Questions & Answers | 2 | 12-24-2006 10:16 AM |
| how to convert from korn shell to normal shell with this code? | forevercalz | Shell Programming and Scripting | 21 | 11-23-2005 02:18 AM |
| KORN Shell - Spawn new shell with commands | frustrated1 | Shell Programming and Scripting | 2 | 04-20-2005 02:23 PM |
| Null handling in scripts | mohanprabu | Shell Programming and Scripting | 3 | 01-20-2005 04:50 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Hi,
I am using few ISQL statements to update and delete from a few tables in sybase, now i want to roll back the transaction when any of the statements fail.How i can i capture these errors in the shell scripts.Please advise. Thanks, Gopi |
|
||||
|
catch the errorlevel of the command:
[code] ... /path/to/somecommand ; RC=$? if [ $RC -eq 0 ] ; then print - "everything worked out fine" else print - "something screwed up" fi [code] The errorlevel is set anew for every command issued, so be sure to get it as soon as the program in question is finished. bakunin Last edited by RTM; 09-02-2005 at 08:50 AM.. |
|
|||||
|
Quote:
Last edited by RTM; 09-02-2005 at 08:50 AM.. |
|
||||
|
Checking the return code won't help. What bhgopi wants to do is rollback the transaction within Sybase. By the time you get the Unix return code the transaction is already committed.
Bottom line: You have to check the results and do the rollback or commit entirely from within isql. You probably should be asking this question on a Sybase forum, rather than Unix. |
| Sponsored Links | ||
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|