Null values (again)

Fi-5

Member
Hi!

there was some discussion here about passing NULLs to a procedure in Delphi (using TOraclePackage). My situation is a bit different. I should pass null to a IN OUT NUMBER parameter of the procedure.

And I should read the result from this parameter.

so I can not use simple NULL, but variable. But the only working situation that I found is to use an empty variable of string type.
But this way I can not read the result of the procedure. the string is still null.

Any ideas?

thx.
 
In a TOraclePackage you can pass parFloat (or parInteger) in CallProcedure. This way a NULL is passed into the procedure, and after the procedure returns you can call GetParameter to obtain the output value.

It's much easier to use the Package Wizard though. It hides all the complicated issues.
 
Yes. If p_abc is an integer in/out parameter, the following call will pass a Null into the procedure and will retrieve the value after the call:
Code:
MyPackage.CallProcedure('myproc', ['p_abc', parInteger]);
abc := MyPackage.GetParameter('p_abc');
 
Originally posted by Marco Kalter:
In a TOraclePackage you can pass parFloat (or parInteger) in CallProcedure. This way a NULL is passed into the procedure, and after the procedure returns you can call GetParameter to obtain the output value.

It's much easier to use the Package Wizard though. It hides all the complicated issues.
Marco,

I have the exact same problem and I am using the Package Wizard (which is very useful!). The Wizard creates Double Delphi parameter types from NUMBER(11) Oracle types, even for in/out params. How can I pass null here and get a number back from the procedure? Maybe it should not convert to Double but to Variant which it uses internally anyway...

This is on DOA 4.0.6.2

Thanks
 
Back
Top