TZStoredProc trouble with output parameter, MSSQL
Posted: 09.02.2018, 16:39
Hello there,
I'm currently experiencing a problem with TZStoredProc calling a MSSQL stored procedure with an output parameter.
Using Lazarus 1.7, FPC 3.1.1, i386-win32-win32, Zeos 7.2.1-rc (fpcdeluxe v1.4.0k for i386-win32), MSSQL 2008 (SQL Server 11.0.2100)
The SP was defined as:
The connection/sp components were defined as (exrpt from .lfm file):
When trying to activate the SP it gives me an Debugger Exception Notification:
The exception doesn't show when the @p2 parameter is an int.
Any hints will be greatly appreciated!
Regards,
I'm currently experiencing a problem with TZStoredProc calling a MSSQL stored procedure with an output parameter.
Using Lazarus 1.7, FPC 3.1.1, i386-win32-win32, Zeos 7.2.1-rc (fpcdeluxe v1.4.0k for i386-win32), MSSQL 2008 (SQL Server 11.0.2100)
The SP was defined as:
Code: Select all
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE test_sp1
@p1 int = 0,
@p2 VARCHAR(16) output
AS
BEGIN
SET NOCOUNT ON;
SELECT @p1, @p2
END
GO
Code: Select all
object ZConnection1: TZConnection
ControlsCodePage = cCP_UTF8
ClientCodepage = 'WINDOWS-1251'
Properties.Strings = (
'AutoEncodeStrings=ON'
'codepage=WINDOWS-1251'
'controls_cp=CP_UTF8'
)
Connected = True
HostName = '192.168.0.5'
Port = 0
Database = 'ePark'
User = 'alpi'
Password = 'passwd'
Protocol = 'FreeTDS_MsSQL>=2005'
LibraryLocation = 'C:\AI\_\test1\sybdb.dll'
end
object ZStoredProc2: TZStoredProc
Connection = ZConnection1
Params = <
item
DataType = ftInteger
Name = '@RETURN_VALUE'
ParamType = ptResult
Value = 0
end
item
DataType = ftInteger
Name = '@p1'
ParamType = ptInput
end
item
DataType = ftString
Name = '@p2'
ParamType = ptInputOutput
end>
StoredProcName = 'test_sp1'
Left = 482
Top = 446
ParamData = <
item
DataType = ftInteger
Name = '@RETURN_VALUE'
ParamType = ptResult
Value = 0
end
item
DataType = ftInteger
Name = '@p1'
ParamType = ptInput
end
item
DataType = ftString
Name = '@p2'
ParamType = ptInputOutput
end>
end
Code: Select all
[Debugger Exception Notification]
Project project1 raised exception class 'EZVariantException' with message:
Types mismatch
In file 'C:\AI\IDE\fpcupdeluxe\ccr\zeos\src\core\ZVariant.pas' at line 567:
raise EZVariantException.Create(STypesMismatch);
[Ignore this exception type]
[Break] [Continue]
Any hints will be greatly appreciated!
Regards,