pg.ddx.io  pgsql-odbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Ludek Finstrle <luf@pzkagis.cz>
To: Milton <milton.siqueira@mapcardoso.com.br>
Cc: pgsql-odbc <pgsql-odbc@postgresql.org>
Subject: Re: I can't read the data in the second time
Date: Tue, 10 Jan 2006 22:05:51 +0100
Message-ID: <20060110210551.GA8098@soptik.pzkagis.cz> (raw)
In-Reply-To: <001c01c615e6$0f4ca360$24000aaa@mapcardoso.com.br>
References: <001c01c615e6$0f4ca360$24000aaa@mapcardoso.com.br>

> 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



view thread (4+ messages)  latest in thread

Message-ID: <20060110210551.GA8098@soptik.pzkagis.cz>
Permalink:  ../20060110210551.GA8098@soptik.pzkagis.cz/
Also on:    postgresql.org/message-id/20060110210551.GA8098@soptik.pzkagis.cz

 · 

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: luf@pzkagis.cz, milton.siqueira@mapcardoso.com.br
  Subject: Re: I can't read the data in the second time
  In-Reply-To: <20060110210551.GA8098@soptik.pzkagis.cz>
  References: <001c01c615e6$0f4ca360$24000aaa@mapcardoso.com.br> <20060110210551.GA8098@soptik.pzkagis.cz>

* 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