ORA-01036: illegal variable name/number
Posted: Thu 23 Nov 2006 11:14
Hi,
We have a application developed in Delphi 5 in which we used ODAC 3.60 for accessing Oracle databases. We upgraded to ODAC 5.70.0.30. After upgrading, the stored procedure created dynamically inside the code produces the ORA-01036: illegal variable name/number error.
Before upgrading it was working without any issues. But after upgrading it produces error. Find the below Delphi 5 code. Please help us to resolve this issue.
We have a application developed in Delphi 5 in which we used ODAC 3.60 for accessing Oracle databases. We upgraded to ODAC 5.70.0.30. After upgrading, the stored procedure created dynamically inside the code produces the ORA-01036: illegal variable name/number error.
Before upgrading it was working without any issues. But after upgrading it produces error. Find the below Delphi 5 code. Please help us to resolve this issue.
Code: Select all
Function AddElement(tblName : string; fieldList: TfieldList;) : string;
var
spAddElement: TOraStoredProc;
spParam: TParam;
begin
try
spAddElement := UStoredProc.Create(FDatabase);
spAddElement.StoredProcName := tblName + '_ADD';
for i := 0 to Pred(fieldList.Count) do
begin
aField.Text := fieldList[i];
spParam := spAddElement.CreateParameter('p' + aField.FldName, aField.FldType, ptInput, 0, aField.FldData);
if aField.IsNull then spParam.Clear;
end;
spAddElement.Params.CreateParam(ftString, 'sNewID', ptOutput).Value := '0';
spAddElement.Prepare;
spAddElement.ExecProc;
result := spAddElement.Params.ParamByName('sNewID').AsString;
finally
spAddElement.Free;
end;
end;