Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: PL/SQL User input

Re: PL/SQL User input

From: Karsten Farrell <kfarrell_at_belgariad.com>
Date: Wed, 12 Mar 2003 17:01:42 GMT
Message-ID: <MPG.18d907d3588be7649896ed@news.la.sbcglobal.net>


rparameswaran_at_junglemate.com said...
> hello,
> I am a newbie to PL/SQL, is there any way by which i can accept user
> input within a Loop,something like
>
> Loop
> getUserInput
> End Loop
>
> Thanks in advance:-)
>

Don't know if this is what you're looking for, but...

SQL> l
  1 declare
  2 arg varchar2(10);
  3 begin
  4 select '&dummy' into arg from dual;   5 dbms_output.put_line('arg='||arg);   6* end;
SQL> set serveroutput on size 1000000
SQL> /
Enter value for dummy: abcde
old 4: select '&dummy' into arg from dual; new 4: select 'abcde' into arg from dual; arg=abcde

PL/SQL procedure successfully completed.

SQL> 2
  2* arg varchar2(10);
SQL> c/varchar2(10)/number
  2* arg number;
SQL> 4
  4* select '&dummy' into arg from dual; SQL> c/'&dummy'/&dummy
  4* select &dummy into arg from dual; SQL> l
  1 declare
  2 arg number;
  3 begin
  4 select &dummy into arg from dual;   5 dbms_output.put_line('arg='||arg);   6* end;
SQL> /
Enter value for dummy: 123
old 4: select &dummy into arg from dual; new 4: select 123 into arg from dual; arg=123

PL/SQL procedure successfully completed.

SQL>

-- 
/Karsten
DBA > retired > DBA
Received on Wed Mar 12 2003 - 11:01:42 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US