ORA-24372 - invalid object for describe on Oracle 9i
ORA-24372 - invalid object for describe on Oracle 9i
During the process to execute a stored procedure using ODAC and TOraStoredProcedure component, the OCI function OCIDescribeAny() is called to retrieve the procedure parameters. This function returns an ORA-24372 error if the stored procedure is invalid for any reason. Oracle releases 10 and 11 forces the recompilation of the object when describe is executed but that is not the behavior on Oracle 9i.
I was thinking about change the source code of ODAC to force a recompilation and another call to OCIDescribeAny before the error was raised. How can I do that?
Any other ideas?
I was thinking about change the source code of ODAC to force a recompilation and another call to OCIDescribeAny before the error was raised. How can I do that?
Any other ideas?
You can replace the following lines in the TOCICommand.CreateProcCall procedure:
with the following code:
Code: Select all
if NeedDescribe then
InitProcParams(ProcName, Overload);with the following code:
Code: Select all
var
Command: TOCICommand;
...
if NeedDescribe then
try
InitProcParams(ProcName, Overload);
except
on E: EOraError do begin
if E.ErrorCode = 24372 then begin
FConnection.CheckCommand;
Command := FConnection.FCommand;
Command.SetSQL('ALTER PROCEDURE ' + ProcName + ' COMPILE');
Command.Execute;
InitProcParams(ProcName, Overload);
end
else
raise;
end;Automatical procedure compilation occurs during an execution of the query with invoking the stored procedure only. But there is no compilation when you are getting parameters. In this case make the compilation of procedure manually. We think that the source code should not be changed. The user has to decide whether he needs to make compilation or not.
An other way is to execute a procedure of the package.
For example the packages in my company named "module_version" which returns a constant version name and number.
This procedure could be called without any side effects.
So this procedure could be called, but this is not a general solution.
Regards
Jens
For example the packages in my company named "module_version" which returns a constant version name and number.
This procedure could be called without any side effects.
So this procedure could be called, but this is not a general solution.
Regards
Jens