Hi,
On and off I've had problems with Unidac and procedures. It pertains to all versions of unidac I've tried (about 2 and forward). It still exists in 3.50. The problems are mostly with MySQL, but I have had them with SQL Server as well.
The problems are intermittent in that it may work fine for a long time, then suddenly it stops working and the problem occurs. From then on it is persistent.
Incorrect number of parameters for PROCEDURE nn; expected x, got 0
Either I create a procedure on a form or datamodule, or I create it at runtime.
Case 1. On a datamodule.
I drop it on a form, tie it to a connection and select a procedure name from the database. It will get all parameters and all is well. Then suddenly (in a day or a week) it stops. It looses all parameters and I get the above error message running the app.
Case 2. Creating a procedure on the run.
Typically I do this in threads.
Result := TUniStoredProc.Create( nil );
Result.Connection := Connection;
Result.StoredProcName := AProcedureName;
Result.Prepare;
Result.Params.CreateParam( ftInteger, 'ADistributionId', ptInput );
When opening the procedure I get the error message.
My current project has worked fine for a long time. Suddenly it doesn't any more. Converting the code to use ADO (which I don't really want to do) eliminates the problem. Switching back brings the problem back.
I have tried to move the database between servers but the problem persists, so it may be the database that causes the problem, even though the test with ADO components tell me it's most likely not.
Thankful for all suggestions.
/Ric
Incorrect number of parameters for PROCEDURE nn; expected
-
- Posts: 13
- Joined: Mon 12 Apr 2010 15:23