Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: How to pass a boolean parameter to an oracle PL/SQL procedure
Cindy,
>> >> ERROR at line 1: >> >> ORA-06553: PLS-306: wrong number or types of arguments in call to 'BOUNCE' >> >> >> >> How do I pass the second parameter as a boolean?
You have two options:
return("DECLARE \n" // 1Received on Wed Apr 28 2004 - 01:53:52 CDT
+"/* Generated By OrindaBuild 4.0.1875 */ \n" // 2
+"/* Which can be obtained at www.orindasoft.com */ \n" // 3
+"functionResult BOOLEAN := null; \n" // 4
+"functionResult_SN SIGNTYPE := null; \n" // 5
+"in_param BOOLEAN := null; \n" // 6
+"in_param_SN SIGNTYPE := ?; \n" // 7
+"BEGIN \n" // 8
+" \n" // 9
+"IF (in_param_SN IS NULL OR in_param_SN = 0) THEN \n" // 10
+" in_param := null; \n" // 11
+"ELSIF in_param_SN = -1 THEN \n" // 12
+" in_param := FALSE; \n" // 13
+"ELSIF in_param_SN = 1 THEN \n" // 14
+" in_param := TRUE; \n" // 15
+"END IF; \n" // 16
+"functionResult := DATATYPE_TEST.BOOLEAN_FUNC(in_param); \n"
// 17
+" \n" // 18
+"IF functionResult IS NULL THEN \n" // 19
+" functionResult_SN := 0; \n" // 20
+"ELSIF functionResult = FALSE THEN \n" // 21
+" functionResult_SN := -1; \n" // 22
+"ELSIF functionResult = TRUE THEN \n" // 23
+" functionResult_SN := 1; \n" // 24
+"END IF; \n" // 25
+"? := functionResult_SN; \n" // 26
+"END; "); // 27 656 characters
This may look more complicated but avoids the creation of a wrapper procedure for your original one. Because it's an anonymous block it stops existing when you finish, and thus doesn't change the design of your DB by adding new procedures to it. David Rolfe Orinda Software Dublin, Ireland ------------------------------------------------------------------- OrindaBuild - Writing Java to Run PL/SQL www.orindasoft.com