Fw: Problem when used union with differents column legth - Mailing list pgsql-odbc

From Milton
Subject Fw: Problem when used union with differents column legth
Date
Msg-id 002901c615e7$90819d40$24000aaa@mapcardoso.com.br
Whole thread Raw
Responses Re: Fw: Problem when used union with differents column legth  (Ludek Finstrle <luf@pzkagis.cz>)
List pgsql-odbc
 
Execute the script:
--------------------------------------------------------
CREATE TABLE A(
 COL VARCHAR(3)
);
 
CREATE TABLE B(
 COL VARCHAR(6)
);

INSERT INTO A VALUES ('T1');
INSERT INTO A VALUES ('T2');
INSERT INTO A VALUES ('T3');

INSERT INTO B VALUES ('T4');
INSERT INTO B VALUES ('T5');
INSERT INTO B VALUES ('T6');
--------------------------------------------------------

 

The result of the sql: SELECT COL FROM A UNION SELECT COL FROM B
COL

---------

T1

T2

T3

T4

T5

T6

 

 

But when i use rdoResultset(DAO), the result is:

COL

-----------

T1

T1

T1

T1

T1

T1

 

Now i use the sql "SELECT COL::varchar(6) FROM A UNION SELECT COL FROM B"

with rdoresultset i have the positive result:

COL

---------

T1

T2

T3

T4

T5

T6


 

In the others db´s drive it work...

 

 

I read the data with rdoResultset like this:

===========================

set rdoQuery = connection.OpenResultset("SELECT COL FROM A UNION SELECT COL FROM B
", rdOpenKeyset, rdConcurReadOnly)

do while rdoQuery.EOF

    Debug.print(rdoQuery!Col)

    rdoQuery.MoveNext

loop

============================

 

 

Thanks...

 

 

pgsql-odbc by date:

Previous
From:
Date:
Subject: [ psqlodbc-Bugs-1000510 ] Access the rdoResultset´s column is NULL in the second access
Next
From:
Date:
Subject: [ psqlodbc-Bugs-1000509 ] TextAsLongVarchar=0 don't work