Unix Technical Forum

Problem with parameter passing

This is a discussion on Problem with parameter passing within the Oracle Miscellaneous forums, part of the Oracle Database category; --> Hello Hi everybody ! I have a problem getting back out parameter values, when exceptions are raised. Here is ...


Go Back   Unix Technical Forum > Database Server Software > Oracle Database > Oracle Miscellaneous

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-07-2008, 08:53 AM
Jérôme VUIBERT
 
Posts: n/a
Default Problem with parameter passing

Hello Hi everybody !

I have a problem getting back out parameter values, when exceptions are
raised.

Here is my problem :

Let say I have the following sql script

-------------------------------------
script
-------------------------------------

declare
l_param VARCHAR2 := 'tata';
l_status INTEGER;
begin
package_name.procedure_name(l_param , l_status);
dbms_output.putline('l_status = ' || l_status);

exception
when others then
dbms_output.putline('exception - l_status = ' || l_status);
end;

and the following definition of the procedure (i didn't write all the
package declaration, synonyms, grant and so on)
-------------------------------------
package, procedure definition
-------------------------------------

PROCEDURE procedure_name(l_p IN VARCHAR2, l_s OUT INTEGER);
IS
begin
l_s := 0;

if (l_p <> 'tata') then
l_s := -1;
raise_application_error(-20100, 'Different of tata');
end if;
end;

----
The problem the following :
1. When i set l_param toto 'tata', I have the following message displayed :
l_status = 0;
2; But when i set l_param to 'tutu', I have the following message displayed
:
exception - l_status =
(there is no value after the = sign)

Why the value of the parameter is not passed???????????????????????????????

I have also noticed the follwing facts :
- if procedure_name calls another procedure (other_procedure) which is
declared on the same way (in parameters, and one out parameter for a status
(let say the_status)),
- the return value from other_procedure in the_status is correct
- if i equals l_s to the_status, in procedure_name, l_s as the correct
value
- but in the script l_status does not contain value if an exception has
been raised .

---------

I know this is not a traditionnal way for exception programming, but we have
to get some out parameters if an exxception is raised.

Already a big thank for people who will give a solution at my problem.

Sincerely.

Jerome



Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 05:16 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com