I can´t read the data in the second time

I can´t read the data in the second time

am 10.01.2006 14:02:03 von milton

This is a multi-part message in MIME format.

------=_NextPart_000_0019_01C615C4.85EBBC30
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

There are cases than i can=B4t read the data one more time.
See the VB example below:

==================== =====3D=
=======3D
dim rdoQuery as rdoResultset
dim strValue as string

set rdoQuery =3D connection.OpenResultset("SELECT '1' || '2' AS test", =
rdOpenKeyset, rdConcurReadOnly)

strValue =3D rdoQuery(0) ' Value is '12'
strValue =3D rdoQuery(0) ' ERROR HERE: Invalid user of Null


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



The similar example work in the others DB (ORACLE, SQL SERVER, INFORMIX)



Is it a bug in the pgsql-odbc?



P.S. : I have a program to test it, if someone would like to use this, =
notify me, ok!!?


------=_NextPart_000_0019_01C615C4.85EBBC30
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable



http-equiv=3DContent-Type>




There are cases than i can=B4t read the =
data one more=20
time.

See the VB example below:

 

size=3D2>=================3D =====3D=
==========

dim rdoQuery as =
rdoResultset

dim strValue as string

 

set rdoQuery =3D =
connection.OpenResultset("SELECT '1'=20
|| '2' AS test", rdOpenKeyset, rdConcurReadOnly)

 

strValue =3D rdoQuery(0) ' Value is =
'12'


strValue =3D rdoQuery(0) ' ERROR HERE: =
Invalid user=20
of Null


 


size=3D2>=================3D =====3D=
==========


 


size=3D2>The=20
similar example work in the others DB (ORACLE, SQL SERVER, =
INFORMIX)


 


size=3D2>Is it a=20
bug in the pgsql-odbc?


 


size=3D2>P.S. : I=20
have a program to test it, if someone would like to use this, notify me, =

ok!!?



------=_NextPart_000_0019_01C615C4.85EBBC30--

Re: I can´

am 10.01.2006 18:10:27 von Ludek Finstrle

> The similar example work in the others DB (ORACLE, SQL SERVER, INFORMIX)

Could you try this with another type in these DB (I think one for which
isn't known maximal size). It could be blob, clob or whatever. I don't
know these RDBMS so well.

It could be possible that if GetData return whole data in one call ADO
expect that it could return it in next calling again.
But what about case that there have to be called GetData more times
for retrieving whole data? (it have to be text longer then 2100 +- in
you test program and psqlODBC).

Please could you test select a || b from table (where length(a||b) > 2100)?

Thanks for help in bug hunting,

Luf

---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq

Re: I can"t read the data in the second time

am 10.01.2006 22:05:51 von Ludek Finstrle

> There are cases than i can=B4t read the data one more time.
> See the VB example below:
>=20
> ==================== =====
========
> dim rdoQuery as rdoResultset
> dim strValue as string
>=20
> set rdoQuery =3D connection.OpenResultset("SELECT '1' || '2' AS test", =
rdOpenKeyset, rdConcurReadOnly)
>=20
> strValue =3D rdoQuery(0) ' Value is '12'
> strValue =3D rdoQuery(0) ' ERROR HERE: Invalid user of Null
>=20
>=20
> ==================== =====
========
>=20
> The similar example work in the others DB (ORACLE, SQL SERVER, INFORMIX=
)

No. Same situation doesn't work againist MSSQL. When you try
"SELECT column FROM table1" where column is type longvarchar it fails
againist MSSQL:
==================== =====3D=
10.1. 2006 22:55:41=================3D= 3D=
=======3D
Access Column 'text' failed=20
Error: 40002 - S1109: [Microsoft][SQL Native Client]Invalid cursor positi=
on
rdoErrors: 0 - S1109: [Microsoft][SQL Native Client]Invalid cursor positi=
on
==================== =====3D=
10.1. 2006 22:55:41=================3D= 3D=
=======3D

==================== =====3D=
10.1. 2006 22:55:40=================3D= 3D=
=======3D
Query opened
Command to Open SQL: OpenResultset('select codi as text from table1', rd=
OpenKeyset, rdConcurReadOnly)
==================== =====3D=
10.1. 2006 22:55:40=================3D= 3D=
=======3D

PgSQL backend handles varchar as text in functions. I don't know how to
change it. We don't know text type size. We can't get it from
backend (at least I don't know how). So ADO choose SQLGetData method
to get it. There is limitation to not call SQLGetData after whole
data is getting from column.

> Is it a bug in the pgsql-odbc?

I think it's not a bug in psqlodbc.

Workarounds:
1) retype column from text to varchar explicitely
2) turn off Text as LongVarchar in Datasource settings

I hope it helps or someone point that I make mistake somewhere.

Regards,

Luf

---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

http://archives.postgresql.org

Re: I can"t read the data in the second time

am 10.01.2006 22:39:09 von milton

> 2) turn off Text as LongVarchar in Datasource settings

It=B4s work only the last version (isn=B4t 08.01.06) than you were send t=
o me.

This version solve all my problems...

Thanks, Luf!!!


----- Original Message -----
From: "Ludek Finstrle"
To: "Milton"
Cc: "pgsql-odbc"
Sent: Tuesday, January 10, 2006 5:05 PM
Subject: Re: [ODBC] I can't read the data in the second time


> There are cases than i can=B4t read the data one more time.
> See the VB example below:
>
> ==================== =====
========
> dim rdoQuery as rdoResultset
> dim strValue as string
>
> set rdoQuery =3D connection.OpenResultset("SELECT '1' || '2' AS test",
rdOpenKeyset, rdConcurReadOnly)
>
> strValue =3D rdoQuery(0) ' Value is '12'
> strValue =3D rdoQuery(0) ' ERROR HERE: Invalid user of Null
>
>
> ==================== =====
========
>
> The similar example work in the others DB (ORACLE, SQL SERVER, INFORMIX=
)

No. Same situation doesn't work againist MSSQL. When you try
"SELECT column FROM table1" where column is type longvarchar it fails
againist MSSQL:
==================== =====3D=
10.1. 2006 22:55:41=================3D= 3D=
=======3D
Access Column 'text' failed
Error: 40002 - S1109: [Microsoft][SQL Native Client]Invalid cursor positi=
on
rdoErrors: 0 - S1109: [Microsoft][SQL Native Client]Invalid cursor positi=
on
==================== =====3D=
10.1. 2006 22:55:41=================3D= 3D=
=======3D

==================== =====3D=
10.1. 2006 22:55:40=================3D= 3D=
=======3D
Query opened
Command to Open SQL: OpenResultset('select codi as text from table1',
rdOpenKeyset, rdConcurReadOnly)
==================== =====3D=
10.1. 2006 22:55:40=================3D= 3D=
=======3D

PgSQL backend handles varchar as text in functions. I don't know how to
change it. We don't know text type size. We can't get it from
backend (at least I don't know how). So ADO choose SQLGetData method
to get it. There is limitation to not call SQLGetData after whole
data is getting from column.

> Is it a bug in the pgsql-odbc?

I think it's not a bug in psqlodbc.

Workarounds:
1) retype column from text to varchar explicitely
2) turn off Text as LongVarchar in Datasource settings

I hope it helps or someone point that I make mistake somewhere.

Regards,

Luf

---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

http://archives.postgresql.org



---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster

Re: I can"t read the data in the second time

am 10.01.2006 23:03:53 von Ludek Finstrle

> > 2) turn off Text as LongVarchar in Datasource settings
>=20
> It=B4s work only the last version (isn=B4t 08.01.06) than you were send=
to me.

I know. There was bug in Text as LongVarchar option. Someone else
report it in the bug tracker ;-) I has solved it yesterday.

> This version solve all my problems...

Nice to hear. I'll close the bug-entry.

Regards,

Luf

---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster