Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Problem with parameter passing
Interestingly using NOCOPY compiler hint here would cause OUT parameters to be populated, for example...
Connected to:
Oracle8i Enterprise Edition Release 8.1.7.2.0 - Production
With the Partitioning option
JServer Release 8.1.7.2.0 - Production
SQL> SET SERVEROUTPUT ON
SQL> DECLARE
2 l_param VARCHAR2 (30) := 'tata';
3 l_status INTEGER;
4
5 PROCEDURE procedure_name (
6 l_p IN VARCHAR2, 7 l_s OUT NOCOPY INTEGER) /* note use of NOCOPY here */8 IS
12 IF (l_p = 'tata') 13 THEN 14 l_s := -1; 15 raise_application_error (-20100, 'Different of tata'); 16 END IF;
PL/SQL procedure successfully completed.
SQL> However, I am not sure that it would be a good idea to adopt this practice since the compiler can choose to ignore NOCOPY in some cases causing the behaviour to revert to default. These cases are...
To be clear, a change as small as constraining the number variable passed into the procedure (e.g. to NUMBER (10)) would be sufficient to prevent NOCOPY behaviour and prevent error information from being returned correctly - I would recommend you take a look at Tony's suggestions.
-- Posted via http://dbforums.comReceived on Fri Jul 11 2003 - 07:06:26 CDT
![]() |
![]() |