![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| how to get SQLCODE ? | regnumber | UNIX for Advanced & Expert Users | 1 | 10-15-2008 02:10 AM |
| return DB2 SQLCODE | kjaisan | Shell Programming and Scripting | 0 | 11-16-2005 01:00 PM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
how to get SQLcode
I am doing Archive Purge for a table. Following is the script ... Code:
#! /bin/ksh ############################ # AFI Monitor Script ############################ . /db2/uszlad48/sqllib/db2profile export mondir=/home/bmwdev1/script/krishna/arc export monlog1=$mondir/Archive_ZB_RCBL_ERROR_MSG_MIG_`date +%Y%m%d`.log # connect to DB db2 "connect to r2pdev user bmwdevup using summer08" # extract the records from the table ZB_RCBL_ERROR_MSG_MIG db2 -x "SELECT * FROM ZB_RCBL_ERROR_MSG_MIG WHERE TIMESTAMP_UPDATED < (CURRENT TIMESTAMP - 1 YEAR) WITH UR" >> "$monlog1" echo "extraction completed" while read line do trackingnum=`expr substr "$line" 1 12` trackingnumsuffix=`expr substr "$line" 27 6` msgnum=`expr substr "$line" 47 5` tstmp=`expr substr "$line" 185 26` #Delete the extracted records one by one db2 "DELETE FROM ZB_RCBL_ERROR_MSG_MIG WHERE TRACKING_NUM = '$trackingnum' AND TRACKING_NUM_SUFFIX = $trackingnumsuffix AND TIMESTAMP_UPDATED = '$tstmp'" done < "$monlog1" echo "purging completed" # disconnect from DB2 db2 terminate exit 0 While in the delete query I need to know whether the DELETE query is executed successfully or not. In mainframes we will be having SQLCODE to check this condition. DB using is IBM DB2 Version 8.1 Using Shell script how to get the SQLCODE or else any other way to know whether the row is deleted successfully or not. Can any one help us to fix this problem Krishnakanth |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|