parameters in stored precedures

The stable tester's forum for ZeosLib 7.0.x series

Report problems concerning our Delphi 2009+ version and new Zeoslib 7.0 features here.
Post Reply
woec
Fresh Boarder
Fresh Boarder
Posts: 13
Joined: 23.04.2013, 20:47

parameters in stored precedures

Post by woec »

Hi,

I tried to call a storedprocedure using TZStoredProc Object with a parameter set. Seems, the parameter setting is ignored - the procedure is executed, but the default parameter defined within the stored procedure on the database server is used.
I place a TZStoredProc Object onto the form and set connection infos and a parameter @par1 with properties parametertype= ftInput and datatype = ptInteger
Here is the code:

with sp1 do begin
Close;
ParamByName('@par1').Value := 10;
Open;
end;

TZSQLMonitor tells me just "exec sp1" (without parameters)
sp1 returns data from a query, which works. If I omit the parameter settings in the TSStoredProc Object, I get an error on execution "@par1 unknown"

I use lazarus 1.0.8 and zeoslib 7.0.3 stable and FreeTDSLibrary with protocol set to FreeTDS_MSSQL>=2005; I connect to a MS-SQL Server 2005

Can anyone give me help for the problem?

Johann
woec
Fresh Boarder
Fresh Boarder
Posts: 13
Joined: 23.04.2013, 20:47

Parameters in stored procedures

Post by woec »

Hi,

maybe I should put my problem into the database servers -> ms sql server - thread. There I found a similar problem description in the entry http://zeos.firmos.at/viewtopic.php?t=3483. The contributor solved it by declaring a resultparameter prior to the input parameter.

This makes the input parameter recognized also for me. So it seems to solve the problem in a workaround manner.
But I suspect there is a problem with the interface code of the library.

Johann
Post Reply