procedure output parameter with precision [message #402209] |
Fri, 08 May 2009 01:50 |
mohannksr
Messages: 28 Registered: January 2009
|
Junior Member |
|
|
hi,
in the attached procedure
i am trying to return a decimal
number 16.78.
whether it is possible to return
a decimal number from a procedure..?
whether output parameter of a procedure
can be declared with precision..?
eg:
PROCEDURE CAL_VPF_AMOUNT (PARAMETER1 IN NUMBER,
PARAMETER2 OUT NUMBER(11,4),
PARAMETER3 OUT NUMBER(11,4)
)
IS....
-
Attachment: test1
(Size: 0.46KB, Downloaded 732 times)
|
|
|
|
|
Re: procedure output parameter with precision [message #402251 is a reply to message #402243] |
Fri, 08 May 2009 03:31 |
JRowbottom
Messages: 5933 Registered: June 2006 Location: Sunny North Yorkshire, ho...
|
Senior Member |
|
|
I'm not quite sure I understand you.
A procedure with an out parameter of type NUMBER can return any value that is a valid number.
As 10.02 (for example) is a valid number, it can be returned:SQL> create or replace procedure test_194 (p_in in number
2 ,p_out out number) as
3 begin
4 p_out := p_in;
5 end;
6 /
Procedure created.
SQL>
SQL> set serveroutput on size 10000
SQL>
SQL> declare
2 v_num number;
3 begin
4 test_194 (10.3,v_num);
5
6 dbms_output.put_line('Return value '||v_num);
7 end;
8 /
Return value 10.3
PL/SQL procedure successfully completed.
|
|
|
|