Re: The sql in Bourne shell takes long time

From: Jim Smith <jim_at_ponder-stibbons.com>
Date: Sat, 18 Nov 2006 08:10:49 +0000
Message-ID: <Ux2GesDJAsXFFwWm_at_jimsmith.demon.co.uk>


[Quoted] In message <1163741507.528886.153510_at_e3g2000cwe.googlegroups.com>, "lovecreatesbea..._at_gmail.com" <lovecreatesbeauty_at_gmail.com> writes
>
>But neither works. How can I execute a block of plsql program in Korn
>shell?
>
>[1] - inline plsql
>
>#...
>
>UMASK=`umask`
>umask 277
>sqlplus -s "$user"/"$pass"_at_"$sid" <<-EOF > /dev/null 2>&1
>
>DECLARE
>
>i conf_sequence.seq_val%TYPE; /* plsql extension */
>
>BEGIN
>
>SELECT seq_val
>INTO i
>FROM conf_sequence;
>
>i := i + 1;
>
>UPDATE conf_sequence
>SET seq_val = i
>WHERE sequence_id = '111';
>
>END;
>
>EOF
>umask "$UMASK"
>
>#...
>

You need a / at the beginning of a line to make sqlplus run the pl/sql block.

e.g.

where sequence_i = '111';

end;
/
EOF

-- 
Jim Smith
I'm afraid you've mistaken me for someone who gives a damn.
Received on Sat Nov 18 2006 - 09:10:49 CET

Original text of this message