From: | "Milton" <milton(dot)siqueira(at)mapcardoso(dot)com(dot)br> |
---|---|
To: | "pgsql-odbc" <pgsql-odbc(at)postgresql(dot)org> |
Subject: | Fw: Problem when used union with differents column legth |
Date: | 2006-01-10 13:12:52 |
Message-ID: | 002901c615e7$90819d40$24000aaa@mapcardoso.com.br |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | 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...
From | Date | Subject | |
---|---|---|---|
Next Message | noreply | 2006-01-10 14:33:42 | [ psqlodbc-Bugs-1000510 ] Access the rdoResultsets column is NULL in the second access |
Previous Message | Milton | 2006-01-10 13:02:03 | I can´t read the data in the second time |