Re: Input in a procedure
Date: Fri, 14 Apr 2000 13:58:39 +1000
Message-ID: <8d650m$f6f$1_at_gossamer.itmel.bhp.com.au>
You can, with & (ampersand), but it's not too pretty.
SQL> set serveroutput on
SQL> declare
2 int1 number := &your_number1;
3 int2 number;
4 begin
5 int2 := &your_number2;
6 dbms_output.put_line('int1=' || to_char(int1) || ' int2=' ||
to_char(int2));
7 end;
8* /
Enter value for your_number1: 8
old 2: int1 number := &your_number1;
new 2: int1 number := 8;
Enter value for your_number2: 3
old 5: int2 := &your_number2;
new 5: int2 := 3;
int1=8 int2=3
Have you considered simply passing the parameters?, eg.
1 create or replace procedure my_proc (param1 in number, param2 in
number)as
2 int1 number := param1;
3 int2 number;
4 begin
5 int2 := param2;
6 dbms_output.put_line('int1=' || to_char(int1) || ' int2=' ||
to_char(int2));
7* end;
SQL> /
Procedure created.
SQL> execute my_proc (12,7);
int1=12 int2=7
Jonathan Bartolo wrote in message <38F0F030.C1C8F5C5_at_fastnet.net.mt>...
>With Sql plus 3.2 can a user be prompted in a procedure to input a
>value.
>For example :
>
>The user is asked to select a number and that number selected is
>assigned to an integer declared above.
>
>Can I do it .. ???
>
Received on Fri Apr 14 2000 - 05:58:39 CEST