Problem with TOraStoredProc. Parameters omission and default values
Posted: Tue 22 Jan 2013 08:41
Hello.
I have a problem with TOraStoredProc.
I creates parameters for TOraStoredProc manually using AddParam function. For example, I have a stored procedure on my server:
and I creates parameters:
Execution is successfully.
But if I omit one of these parameters like this:
it raises an exception: ORA-06550 wrong number or types of arguments!
If I use auto creation:
Execution is successfully too. I can omit any parameters and there is no any exceptions, TOraStoredProc replaces omitted parameters with NULL value automatically.
Is it bug, or I forget something? I need create parameters manually and sometimes omit one of them. How to fix it?
Thanks!
I have a problem with TOraStoredProc.
I creates parameters for TOraStoredProc manually using AddParam function. For example, I have a stored procedure on my server:
Code: Select all
create or replace procedure "PROC1"
(
operation NUMBER,
object_id NUMBER
) AS
...
Code: Select all
var parameter : TOraParam;
_storedProcedure : TOraStoredProc;
...
parameter := TOraParam.Create ( nil );
parameter.Name := 'operation';
parameter.ParamType := ptInput;
parameter.Value := value1;
_storedProcedure.Params.AddParam ( parameter );
parameter.Name := 'object_id';
parameter.ParamType := ptInput;
parameter.Value := value2;
_storedProcedure.Params.AddParam ( parameter );
_storedProcedure.Execute ();
But if I omit one of these parameters like this:
Code: Select all
parameter.Name := 'operation';
parameter.ParamType := ptInput;
parameter.Value := value1;
_storedProcedure.Params.AddParam ( parameter );
_storedProcedure.Execute ();
If I use auto creation:
Code: Select all
_storedProcedure.ParamByName ( 'operation' ).AsInteger := value1;
_storedProcedure.ParamByName ( 'object_id' ).AsInteger := value2;
Is it bug, or I forget something? I need create parameters manually and sometimes omit one of them. How to fix it?
Thanks!