pg.ddx.io  pgsql-odbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Milton <milton.siqueira@mapcardoso.com.br>
To: pgsql-odbc <pgsql-odbc@postgresql.org>
Subject: Fw: Problem when used union with differents column legth
Date: Tue, 10 Jan 2006 09:12:52 -0400
Message-ID: <002901c615e7$90819d40$24000aaa@mapcardoso.com.br> (raw)


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...

view thread (2+ messages)  latest in thread

Message-ID: <002901c615e7$90819d40$24000aaa@mapcardoso.com.br>
Permalink:  ../002901c615e7$90819d40$24000aaa@mapcardoso.com.br/
Also on:    postgresql.org/message-id/002901c615e7$90819d40$24000aaa@mapcardoso.com.br

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-odbc@postgresql.org
  Cc: milton.siqueira@mapcardoso.com.br
  Subject: Re: Fw: Problem when used union with differents column legth
  In-Reply-To: <002901c615e7$90819d40$24000aaa@mapcardoso.com.br>
  References: <002901c615e7$90819d40$24000aaa@mapcardoso.com.br>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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