Page 1 of 1

TOraStoredProc error

Posted: Fri 31 Jan 2014 22:19
by jim.eckels
I have the following stored procedure

Code: Select all

CREATE OR REPLACE PROCEDURE MYPROC
(
    30+ params .. ALL inputs number(10, number(5) and varchar2(1)
)
AS
BEGIN

-- do something with those fields, like perhaps an insert to a table or something

EXCEPTION

	WHEN OTHERS THEN
		NULL;

END MYPROC;
/
And the following code to execute it

Code: Select all

  FQuery := TOraStoredProc.Create(Nil);
  FQuery.Session := FConnection.FConnection;
  FQuery.StoredProcName := FName;
  FQuery.AutoCommit := False;
  FQuery.FetchAll := False;
  FQuery.ParamCheck := True;
  FQuery.Prepare;

  // assign my 30+ params here.  verified that all params are assigned


  FQuery.Execute;
This is the message I am getting ...

Code: Select all

First chance exception at $000007FEFD8F940D. Exception class EConvertError with message 'Cannot convert type'. Process TestProject.exe (7004)
Here is the stack trace from debugger ...

Code: Select all

System._RaiseExcept(???)
OraClasses.TOraParamDesc.SetItemAsVariant(11583061,$996EEF8)
OraClasses.InternalSetValue(2046,$B92330)
OraClasses.TOraParamDesc.SetValue(nil)
DBAccess.TCustomDASQL.AssignParamValue($AC33E9,$12AFF0B0)
Ora.TOraSQL.AssignParamValue($AC33E9,$12EBE180)
DBAccess.TCustomDASQL.WriteParams(False)
DBAccess.TCustomDADataSet.Execute
What am I doing wrong here? Why is TOraParamDesc.SetValue(nil) there? I cannot find that in the documentation anywhere.

Re: TOraStoredProc error

Posted: Mon 03 Feb 2014 15:46
by AlexP
Hello,

We cannot reproduce the problem. Please send the full script for creating the procedure, as well as the Delphi code, where you are setting parameter values. In addition, try to analyze the problem: detect the parameter leading to the error.