[archive] SQL Varchar

[Migrated content. Thread originally posted on 19 September 2005]

Hello,
Is anyone having trouble passing SQL Server Varchar fields into working-storage in Acucobol 6.2?
My WS area is set up as follows:

01 A-Test-Data.
05 A-Field1.
06 A-Field1-Length PIC s9(4) comp-5.
06 A-Field1-Name PIC X(50).
05 A-Field2.
06 A-Field2-Length PIC s9(4) comp-5.
06 A-Field2-Name PIC X(50).

My SQL Code looks like this:

EXEC SQL
DECLARE COBCUR1 CURSOR FOR
SELECT Field1
, Field2
FROM TBL_Test WITH (NOLOCK)
FOR READ ONLY
END-EXEC
EXEC SQL
OPEN COBCUR1
END-EXEC
EXEC SQL
FETCH COBCUR1 INTO :A-Test-Data
END-EXEC

where Field1 and Field2 are varchar(50) fields in tbl_Test.

When I execute this code, the data from Field1 is lost and the data from Field2 is put into A-Field1-Name.
If anyone has had similar trouble, please let me know how you solved the problem. The same code worked fine on version 6.0.