Change the substitution variable in this way:
l_chk varchar2(1) :='&chk.'
And turn off the verify option of sqlplus:
set verify off
Regards.
- Amar Kumar Padhi <TS2017_at_emirates.com> wrote:
> This is not feasible within a PL/SQL block. Oracle
> will first prompt you to
> input value for all the & provided in the code,
> before actually executing
> it.
> One option:
> accept chk prompt 'Do you want to continue (y/n)?'
> declare
> l_chk varchar2(1) :='&chk';
> begin
> if l_chk = 'y' then
> dbms_output.put_line('user accepted to
> continue');
> else
> dbms_output.put_line('user cancelled
> operation');
> end if;
> end;
> /
>
>
> rgds
> amar
>
>
>
> -----Original Message-----
> Sent: Thursday, October 04, 2001 11:20 AM
> To: Multiple recipients of list ORACLE-L
>
>
> Hi Gurus,
>
> declare
> v_empno number:=&empno;
> v_sal number:=&sal;
> ok1 varchar(1);
> begin
> dbms_output.put_line('Do you want to update the
> sal...(Y/N)');
> if (upper('&ok1') = 'Y') then
> update emp set sal=v_sal where empno=v_empno;
> end if;
> end;
>
> In the above code if i want to get the 'Do you want
> to update the
> sal...(Y/N)' before the variable ok1 what should i
> do..
> my requirement is that i will take the empno and sal
> first and prompt
> for updating.if i enter 'Y' then i will update the
> sal..
> else i dont.but according to the above code i am
> begin asked to enter
> empno,sal and variable ok1 at the first instance..
> pl help me about this issue...
> --
> Please see the official ORACLE-L FAQ:
> http://www.orafaq.com
> --
> Author: Vijaya Chander V.S
> INET: srinivasa_v_at_infy.com
>
> Fat City Network Services -- (858) 538-5051 FAX:
> (858) 538-5051
> San Diego, California -- Public Internet
> access / Mailing Lists
>
> To REMOVE yourself from this mailing list, send an
> E-Mail message
> to: ListGuru_at_fatcity.com (note EXACT spelling of
> 'ListGuru') and in
> the message BODY, include a line containing: UNSUB
> ORACLE-L
> (or the name of mailing list you want to be removed
> from). You may
> also send the HELP command for other information
> (like subscribing).
> --
> Please see the official ORACLE-L FAQ:
> http://www.orafaq.com
> --
> Author: Amar Kumar Padhi
> INET: TS2017_at_emirates.com
>
> Fat City Network Services -- (858) 538-5051 FAX:
> (858) 538-5051
> San Diego, California -- Public Internet
> access / Mailing Lists
>
> To REMOVE yourself from this mailing list, send an
> E-Mail message
> to: ListGuru_at_fatcity.com (note EXACT spelling of
> 'ListGuru') and in
> the message BODY, include a line containing: UNSUB
> ORACLE-L
> (or the name of mailing list you want to be removed
> from). You may
> also send the HELP command for other information
> (like subscribing).
Eng. Christian Trassens
Senior DBA
Systems Engineer
ctrassens_at_yahoo.com
ctrassens_at_hotmail.com
Phone : 541149816062
Do You Yahoo!?
NEW from Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month.
http://geocities.yahoo.com/ps/info1
--
Please see the official ORACLE-L FAQ: http://www.orafaq.com
--
Author: Christian Trassens
INET: ctrassens_at_yahoo.com
Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051
San Diego, California -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from). You may
also send the HELP command for other information (like subscribing).
Received on Thu Oct 04 2001 - 05:02:58 CDT