Hello!
I'm having trouble running a procedure (TZStoredProc) that contains two output parameters. The error occurs exactly in the parameters, see:
Procedure expects parameter @ p_modulo_por_menu pCodModulo, Which was not supplied.
Procedure expects parameter @ p_modulo_por_menu pNomeModulo, Which was not supplied.
My database is Sybase (unfortunately, because we use it here at work). Previously we were using BDE and we are trying to use to get rid ZeosLib definitely BDE and all its eccentricities.
Using TStoredProc (standard BDE) the procedure runs smoothly. Any ideas?
Sybase Stored Procedure w/ output parameters does not work
Moderators: gto, cipto_kh, EgonHugeist
-
- Junior Boarder
- Posts: 35
- Joined: 30.08.2005, 16:30
- Location: Olinda / PE
- Contact:
-
- Junior Boarder
- Posts: 35
- Joined: 30.08.2005, 16:30
- Location: Olinda / PE
- Contact:
A new information: This error occurs on the second time I run TZStoredProc.ExecProc. Very strange error.
first time:
STPRModuloPorMenu.ParamByName('@pNomeMenu').AsString := 'carlos';
STPRModuloPorMenu.ExecProc;
No error!
Second time:
STPRModuloPorMenu.ParamByName('@pNomeMenu').AsString := 'carlos';
STPRModuloPorMenu.ExecProc;
Error!
first time:
STPRModuloPorMenu.ParamByName('@pNomeMenu').AsString := 'carlos';
STPRModuloPorMenu.ExecProc;
No error!
Second time:
STPRModuloPorMenu.ParamByName('@pNomeMenu').AsString := 'carlos';
STPRModuloPorMenu.ExecProc;
Error!
-
- Junior Boarder
- Posts: 35
- Joined: 30.08.2005, 16:30
- Location: Olinda / PE
- Contact:
More information:
The problem is that the on the second call the params are being cleared. But why this is done?
On the first call the Statement is created. On the second all parameters are cleared (Statement.ClearParameters). Why this is done? I've made a test, removing the else part and the procedure works perfectly.
The question is: This is working correctly for other databases?
The problem is that the on the second call the params are being cleared. But why this is done?
Code: Select all
procedure TZAbstractRODataset.ExecSQL;
begin
CheckConnected;
Connection.ShowSQLHourGlass;
try
if Active then Close;
CheckSQLQuery;
CheckInactive;
if (Statement = nil) or (Statement.GetConnection.IsClosed) then
Statement := CreateStatement(FSQL.Statements[0].SQL, Properties)
else
if (Assigned(Statement)) then
Statement.ClearParameters;
SetStatementParams(Statement, FSQL.Statements[0].ParamNamesArray,
FParams, FDataLink);
FRowsAffected := Statement.ExecuteUpdatePrepared;
finally
Connection.HideSQLHourGlass;
end;
end;
The question is: This is working correctly for other databases?
- mdaems
- Zeos Project Manager
- Posts: 2766
- Joined: 20.09.2005, 15:28
- Location: Brussels, Belgium
- Contact:
Ðerek wildstar,
Seems you're using the 6.6 version. I don't know why these lines are there. I tried to remove them and they did not have any impact on when testing with firebird, sqlite and mysql. Failed to test with oracle and postgres for some strange problem on this computer at the moment.
This code has been reorganised in 7.X. Did you check if all works fine there?
Mark
Seems you're using the 6.6 version. I don't know why these lines are there. I tried to remove them and they did not have any impact on when testing with firebird, sqlite and mysql. Failed to test with oracle and postgres for some strange problem on this computer at the moment.
This code has been reorganised in 7.X. Did you check if all works fine there?
Mark