Additional
dbCAP
AnyDAC
ThinDAC
NCOCI8
Topic: problem with varchar(max) and guid in stored proc
problem with varchar(max) and guid in stored proc
Posted: 2007/10/17 06:08
 
I have a problem with varchar(max) in stored procedure.

I have a procedure with @ERTEK varchar(max) input parameter and @ID uniqueidentifier output parameter and some other input parameters.

Problem: the procedure return Null value.
If I change the @ERTEK parameter's type to varchar(1000), the return value is not null.

The procedure:

 CREATE PROCEDURE ... (     @PAR1             VARCHAR(10),     @PAR2            UNIQUEIDENTIFIER,     ...     @ERTEK           NVARCHAR(MAX),      ...     @ID              UNIQUEIDENTIFIER OUTPUT ) AS BEGIN   SELECT @ID ID      FROM ...   IF @ID IS NULL   BEGIN       SET @ID NEWID()        INSERT INTO...   END   ELSE     UPDATE... END



I use D2007, MSSQL 2005, AnyDac 1.12.2

Best regards,
Peter

Post edited by: rempet, at: 2007/10/17 06:09
Re:problem with varchar(max) and guid in stored proc
Posted: 2007/10/17 06:17
 
Hello

That is a known issue. I plan to fix it in v 2.1. If procedure have at least one blob parameter and some out parameters, then after execution, out parameter values will be not returned. Possible workarounds:
- replace blob with varchar (not max);
- do not use output params with input blob params.

Regards,
Dmitry
Re:problem with varchar(max) and guid in stored proc
Posted: 2007/10/17 06:28
 
Thanks your fast reply.

I wait for the version 2.1

Peter