The sql in Bourne shell takes long time
From: lovecreatesbea..._at_gmail.com <lovecreatesbeauty_at_gmail.com>
Date: 16 Nov 2006 02:14:26 -0800
Message-ID: <1163672066.049311.307210_at_h54g2000cwb.googlegroups.com>
[Quoted] [Quoted] I have a written following sql statements in the Bourne shell script. [Quoted] [Quoted] But when I run the shell script, it takes a long time and doesn't give out any result. I have to interrupt it by Ctrl-C or kill -9. The code has no syntax errors and the variables like $user, $pass and $sid have been assigned before invoking sqlplus.
Date: 16 Nov 2006 02:14:26 -0800
Message-ID: <1163672066.049311.307210_at_h54g2000cwb.googlegroups.com>
[Quoted] [Quoted] I have a written following sql statements in the Bourne shell script. [Quoted] [Quoted] But when I run the shell script, it takes a long time and doesn't give out any result. I have to interrupt it by Ctrl-C or kill -9. The code has no syntax errors and the variables like $user, $pass and $sid have been assigned before invoking sqlplus.
#...
[Quoted] UMASK=`umask` umask 277 sqlplus -s "$user"/"$pass"_at_"$sid" <<-EOF > /dev/null 2>&1 UPDATE CONF_SEQUENCE T SET T.SEQ_VAL = (SELECT DECODE(A.SEQ_INIT_FLAG, 0, A.SEQ_VAL+1, DECODE(TRUNC(SYSDATE)-A.SEQ_DATE, 0, A.SEQ_VAL+1, 1)) [Quoted] [Quoted] FROM CONF_SEQUENCE A WHERE A.SEQ_NAME='ALARM_ID'), T.SEQ_DATE = TRUNC(SYSDATE) WHERE T.SEQ_NAME='ALARM_ID'; COMMIT; SELECT * FROM conf_sequence; exit EOF umask "$UMASK"Received on Thu Nov 16 2006 - 11:14:26 CET
#...