X-Original-To: pgsql-odbc-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 9040F9DC81C for ; Tue, 10 Jan 2006 11:47:57 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 29761-07-2 for ; Tue, 10 Jan 2006 11:47:56 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from mailer3.internext.com.br (unknown [200.241.116.2]) by postgresql.org (Postfix) with SMTP id 4B5829DCC6F for ; Tue, 10 Jan 2006 09:13:15 -0400 (AST) Received: (qmail 91255 invoked by uid 1127); 10 Jan 2006 13:13:19 -0000 Received: from milton.siqueira@mapcardoso.com.br by mailer3.internext.com.br by uid 1002 with qmail-scanner-1.22 (uvscan: v4.2.40/v4367. spamassassin: 2.50. Clear:RC:1(200.208.241.186):. Processed in 4.579152 secs); 10 Jan 2006 13:13:19 -0000 Received: from b04ip186.internext.com.br (HELO map0502) (200.208.241.186) by mailer3.internext.com.br with SMTP; 10 Jan 2006 13:13:14 -0000 Message-ID: <002901c615e7$90819d40$24000aaa@mapcardoso.com.br> From: "Milton" To: "pgsql-odbc" Subject: Fw: Problem when used union with differents column legth Date: Tue, 10 Jan 2006 09:12:52 -0400 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0026_01C615C6.08EC7560" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4927.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4927.1200 X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.416 required=5 tests=[AWL=-0.176, HTML_MESSAGE=0.001, UPPERCASE_50_75=0.591] X-Spam-Score: 0.416 X-Spam-Level: X-Archive-Number: 200601/89 X-Sequence-Number: 6904 This is a multi-part message in MIME format. ------=_NextPart_000_0026_01C615C6.08EC7560 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable 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 =20 =20 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=B4s drive it work... I read the data with rdoResultset like this: =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D set rdoQuery =3D connection.OpenResultset("SELECT COL FROM A UNION = SELECT COL FROM B ", rdOpenKeyset, rdConcurReadOnly) do while rdoQuery.EOF Debug.print(rdoQuery!Col) rdoQuery.MoveNext loop =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D Thanks... ------=_NextPart_000_0026_01C615C6.08EC7560 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
 
Execute the script:
--------------------------------------------------------<= /DIV>
CREATE TABLE A(
 COL=20 VARCHAR(3)
);
 
CREATE TABLE B(
 COL=20 VARCHAR(6)
);

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

INSERT INTO B VALUES = ('T4');
INSERT INTO B=20 VALUES ('T5');
INSERT INTO B VALUES ('T6');
--------------------------------------------------------<= /FONT>

 

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

---------

T1

T2

T3

T4

T5

T6

 

 

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

COL

-----------

T1

T1

T1

T1

T1

T1

 

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

with=20 rdoresultset i have the positive result:

COL

---------

T1

T2

T3

T4

T5

T6


 

In the=20 others db=B4s drive it work...

 

 

I read=20 the data with rdoResultset like this:

=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D

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

do while=20 rdoQuery.EOF

    Debug.print(rdoQuery!Col)

    rdoQuery.MoveNext

loop

=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D

 

 

Thanks...

 

 

------=_NextPart_000_0026_01C615C6.08EC7560--