Hi There,
I wonder if someonw could please help me with a problem that I am having calling an Oracle srtored procedure using ODAC in Delphi.
I am passing 22 parameters t a stored procedure, with the final paramater being an output paramater, which the stored procedure places a value into.
In Delphi I am using the follwoing code to retrieve the return value from the stored procedure :-
Form_RingDataSet.CurrentMeasring.DBAResult :=
OraStoredProc1.ParamByName('P_RETURN_RESULT').AsString;
However this causes an unknow error.
Could anyone plase point me in the right direction, or provide a code sample.
Thank you for your help.
getting a return parameter from an Orcale SP using Delphi
We cannot reproduce you problem. What error message do you have? Please
check that OraStoredProc1.ParamByName('P_RETURN_RESULT').ParamType=ptOutput.
Please do the following.
Put a new TOraStoredProc component to the form. Double click on it and enter
stored procedure name in design-time dialog. Go to parameters page and check
that ParamType for 'P_RETURN_RESULT' is Output. Write the following code in
button click event
var
s: string;
begin
OraStoredProc1.ParamByName(...).AsString := ...;// AsString for string
parameters
...
OraStoredProc1.ParamByName(...).AsString := ...;
OraStoredProc1.Execute
s :=OraStoredProc1.ParamByName('P_RETURN_RESULT').AsString;
end;
check that OraStoredProc1.ParamByName('P_RETURN_RESULT').ParamType=ptOutput.
Please do the following.
Put a new TOraStoredProc component to the form. Double click on it and enter
stored procedure name in design-time dialog. Go to parameters page and check
that ParamType for 'P_RETURN_RESULT' is Output. Write the following code in
button click event
var
s: string;
begin
OraStoredProc1.ParamByName(...).AsString := ...;// AsString for string
parameters
...
OraStoredProc1.ParamByName(...).AsString := ...;
OraStoredProc1.Execute
s :=OraStoredProc1.ParamByName('P_RETURN_RESULT').AsString;
end;