pg.ddx.io pgsql-odbc@postgresql.org mailing list archive
help / color / mirror / Atom feedFw: Problem when used union with differents column legth
2+ messages / 2 participants
[nested] [flat]
* Fw: Problem when used union with differents column legth
@ 2006-01-10 13:12 Milton <milton.siqueira@mapcardoso.com.br>
0 siblings, 1 reply; 2+ messages in thread
From: Milton @ 2006-01-10 13:12 UTC (permalink / raw)
To: 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...
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: Fw: Problem when used union with differents column legth
@ 2006-01-10 17:05 Ludek Finstrle <luf@pzkagis.cz>
parent: Milton <milton.siqueira@mapcardoso.com.br>
0 siblings, 0 replies; 2+ messages in thread
From: Ludek Finstrle @ 2006-01-10 17:05 UTC (permalink / raw)
To: Milton <milton.siqueira@mapcardoso.com.br>; +Cc: pgsql-odbc
> But when i use rdoResultset(DAO), the result is:
>
> COL
> -----------
> T1
> T1
> T1
> T1
> T1
> T1
There is a problem in PGAPI_SetPos function.
Please try this patch which solve the problem.
Patch attached. Please test review and comment
Luf
Attachments:
psqlodbc-setpos.dif (text/plain, 453B) download
diff -c psqlodbc.orig\results.c psqlodbc\results.c
*** psqlodbc.orig\results.c Fri Dec 09 02:55:48 2005
--- psqlodbc\results.c Tue Jan 10 19:04:56 2006
***************
*** 3116,3121 ****
--- 3116,3123 ----
if (gdata)
for (i = 0; i < num_cols; i++)
gdata[i].data_left = -1;
+ if (irow < rowsetSize)
+ s.stmt->currTuple = s.stmt->rowset_start + irow - 1;
ret = SQL_SUCCESS;
#ifdef DRIVER_CURSOR_IMPLEMENT
conn = SC_get_conn(s.stmt);
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2006-01-10 17:05 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2006-01-10 13:12 Fw: Problem when used union with differents column legth Milton <milton.siqueira@mapcardoso.com.br>
2006-01-10 17:05 ` Ludek Finstrle <luf@pzkagis.cz>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox