pg.ddx.io  pgsql-odbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
I can´t read the data in the second time
4+ messages / 2 participants
[nested] [flat]

* I can´t read the data in the second time
@ 2006-01-10 13:02  Milton <milton.siqueira@mapcardoso.com.br>
  0 siblings, 1 reply; 4+ messages in thread

From: Milton @ 2006-01-10 13:02 UTC (permalink / raw)
  To: pgsql-odbc

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

================================
dim rdoQuery as rdoResultset
dim strValue as string

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

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


================================



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!!?

^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: I can't read the data in the second time
@ 2006-01-10 21:05  Ludek Finstrle <luf@pzkagis.cz>
  parent: Milton <milton.siqueira@mapcardoso.com.br>
  0 siblings, 1 reply; 4+ messages in thread

From: Ludek Finstrle @ 2006-01-10 21:05 UTC (permalink / raw)
  To: Milton <milton.siqueira@mapcardoso.com.br>; +Cc: pgsql-odbc

> There are cases than i can´t read the data one more time.
> See the VB example below:
> 
> ================================
> dim rdoQuery as rdoResultset
> dim strValue as string
> 
> set rdoQuery = connection.OpenResultset("SELECT '1' || '2' AS test", rdOpenKeyset, rdConcurReadOnly)
> 
> strValue = rdoQuery(0) ' Value is '12'
> strValue = 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:
=========================10.1. 2006 22:55:41=========================
 Access Column 'text' failed 
Error: 40002 - S1109: [Microsoft][SQL Native Client]Invalid cursor position
rdoErrors: 0 - S1109: [Microsoft][SQL Native Client]Invalid cursor position
=========================10.1. 2006 22:55:41=========================

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

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



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: I can't read the data in the second time
@ 2006-01-10 21:39  Milton <milton.siqueira@mapcardoso.com.br>
  parent: Ludek Finstrle <luf@pzkagis.cz>
  0 siblings, 1 reply; 4+ messages in thread

From: Milton @ 2006-01-10 21:39 UTC (permalink / raw)
  To: Ludek Finstrle <luf@pzkagis.cz>; +Cc: pgsql-odbc

> 2) turn off Text as LongVarchar in Datasource settings

It´s work only the last version (isn´t 08.01.06) than you were send to me.

This version solve all my problems...

Thanks, Luf!!!


----- Original Message -----
From: "Ludek Finstrle" <luf@pzkagis.cz>
To: "Milton" <milton.siqueira@mapcardoso.com.br>
Cc: "pgsql-odbc" <pgsql-odbc@postgresql.org>
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´t read the data one more time.
> See the VB example below:
>
> ================================
> dim rdoQuery as rdoResultset
> dim strValue as string
>
> set rdoQuery = connection.OpenResultset("SELECT '1' || '2' AS test",
rdOpenKeyset, rdConcurReadOnly)
>
> strValue = rdoQuery(0) ' Value is '12'
> strValue = 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:
=========================10.1. 2006 22:55:41=========================
 Access Column 'text' failed
Error: 40002 - S1109: [Microsoft][SQL Native Client]Invalid cursor position
rdoErrors: 0 - S1109: [Microsoft][SQL Native Client]Invalid cursor position
=========================10.1. 2006 22:55:41=========================

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

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





^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: I can't read the data in the second time
@ 2006-01-10 22:03  Ludek Finstrle <luf@pzkagis.cz>
  parent: Milton <milton.siqueira@mapcardoso.com.br>
  0 siblings, 0 replies; 4+ messages in thread

From: Ludek Finstrle @ 2006-01-10 22:03 UTC (permalink / raw)
  To: Milton <milton.siqueira@mapcardoso.com.br>; +Cc: pgsql-odbc

> > 2) turn off Text as LongVarchar in Datasource settings
> 
> It´s work only the last version (isn´t 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



^ permalink  raw  reply  [nested|flat] 4+ messages in thread


end of thread, other threads:[~2006-01-10 22:03 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2006-01-10 13:02 I can´t read the data in the second time Milton <milton.siqueira@mapcardoso.com.br>
2006-01-10 21:05 ` Re: I can't read the data in the second time Ludek Finstrle <luf@pzkagis.cz>
2006-01-10 21:39   ` Re: I can't read the data in the second time Milton <milton.siqueira@mapcardoso.com.br>
2006-01-10 22:03     ` Re: I can't read the data in the second time 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