Additional
dbCAP
AnyDAC
ThinDAC
NCOCI8
Topic: Output parameter problem with varchar(max)
Output parameter problem with varchar(max)
Posted: 2008/04/16 05:53
 
Hi Diman!

I use AnyDAC 1.12.2 (Build 225) with Delphi 2007 and MSSQL 2005.
I have a stored proc which manipulates data (insert and update).
The stored proc has an uniqueidentifier Input/Output parameter, a varchar(max) and some other input parameter.
I can't get the stored proc output parameter value.
If I change the varchar(max) parameter to varchar(1000), all is ok.
I try to find this error with SQL ServerProfiler and get the folowing results:

1. varchar(max)

  EXEC [PAE21_ELETMOD'INS_UPD','251CF3B1-2F8F-4378-B952-F1808D9AEF40','594260DE-7C93-4797-8B20-42EAD671CAF0','E817D97C-1ACC-4209-BD40-EDF1D87D3DDC','692E0D8D-5286-44C5-8E9D-4758CD224E26',NULL,NULL,'0BBF721B-FF7F-4DD0-AAF5-416E7801E622','1E4E355F-37BE-4A46-A227-A0F91AFA40EC',NULL,NULL,'B888CB6B-7D6D-46BC-B15C-FF10A6F8EDFC','33500504-0E6C-4A21-84A1-3273B70C3E4F',1,2,1,1,1,1,1,0,0,'FE38F875-B181-46F7-9FAB-F5C7BB613384','wqe234maxi ',



2. varchar(1000)

  declare @p2 uniqueidentifier set @p2='AF8C6407-2784-4625-A4AB-C9C40B029205' exec [PAE21_ELETMOD'INS_UPD',@p2  output,'594260DE-7C93-4797-8B20-42EAD671CAF0','E817D97C-1ACC-4209-BD40-EDF1D87D3DDC','692E0D8D-5286-44C5-8E9D-4758CD224E26',NULL,NULL,'0BBF721B-FF7F-4DD0-AAF5-416E7801E622','1E4E355F-37BE-4A46-A227-A0F91AFA40EC',NULL,NULL,'B888CB6B-7D6D-46BC-B15C-FF10A6F8EDFC','33500504-0E6C-4A21-84A1-3273B70C3E4F',1,2,1,1,1,1,1,0,0,'FE38F875-B181-46F7-9FAB-F5C7BB613384','wqe234maxi ',1 select @p2



The 2. parameter is the output and the 24. parameter is the problematic varchar.
Is it an AnyDac bug?

Thank you for your help in advance
Best regards,
Peter

Post edited by: rempet, at: 2008/04/16 05:54
Re:Output parameter problem with varchar(max)
Posted: 2008/04/17 01:58
 
Could you post here your stored proc header ?
Re:Output parameter problem with varchar(max)
Posted: 2008/04/17 02:17
 

  CREATE PROCEDURE [dbo].[PAE21_ELETMOD] (     @MOD              VARCHAR(50),     @ID               UNIQUEIDENTIFIER OUTPUT,     @TAP01            UNIQUEIDENTIFIER,     @TAP02            UNIQUEIDENTIFIER,     @TXX12_Dohanyzas  UNIQUEIDENTIFIER,     @i_DohanyKezd     INT,     @i_DohanyVege     INT,     @TXX12_Alkohol    UNIQUEIDENTIFIER,     @TXX12_Drog       UNIQUEIDENTIFIER,     @i_DrogKezd       INT,     @i_DrogVege       INT,     @TXX12_Testmozgas UNIQUEIDENTIFIER,     @TXX12_Stressz    UNIQUEIDENTIFIER,     @b_TapGyakorisag  BIT,     @i_TapJellege     TINYINT,     @b_Diabetes       BIT,     @b_Feherje        BIT,     @b_Purin          BIT,     @b_Soszegeny      BIT,     @b_NativCukor     BIT,     @b_Kaloria        BIT,     @b_Zsirszegeny    BIT,     @TXX12_CsaladiAll UNIQUEIDENTIFIER,     @c_Megjegyzes     VARCHAR(MAX),     @COE              BIT )

Re:Output parameter problem with varchar(max)
Posted: 2008/04/17 03:53
 
Hello

This is the known bug. It is not yet resolved, even in 2.x.

If SP has input blob parameters, then it does not return output parameter values. You can try to return result set from SP, consisting of output value, and use ADStoredProc1.Open.

Regards,
Dmitry
Re:Output parameter problem with varchar(max)
Posted: 2008/04/17 06:01
 
Thank you