Re: psqlODBC text length with no records

From: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
To: Barry Bell <Barry(dot)Bell(at)hartehanks(dot)com>, Hiroshi Saito <hiroshi(at)winpg(dot)jp>, Michael Paquier <michael(dot)paquier(at)gmail(dot)com>, Hiroshi Inoue <inoue(at)tpf(dot)co(dot)jp>
Cc: Heikki Linnakangas <hlinnakangas(at)vmware(dot)com>, Anna Gershnik <agershnik(at)tableausoftware(dot)com>, "pgsql-odbc(at)postgresql(dot)org" <pgsql-odbc(at)postgresql(dot)org>
Subject: Re: psqlODBC text length with no records
Date: 2014-05-14 00:27:33
Message-ID: 5372B875.3010407@aklaver.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-odbc

On 05/13/2014 07:04 AM, Barry Bell wrote:
> Hi:
> When calling PostgresODBC (ver 9.2.1) using the following settings for VFP(Foxpro)
> BI=2;TextAsLongVarchar=1;UnknownSizes=2;UseServerSidePrepare=1;B0=254;B7=1;C5=0;AB=8;" && Debug=1;B2=1
>
> Select initcap(name) cname from customers (where name is type varchar)
> If records are returned, Returns pname as the varchar of length of the field (varchar 30 in this case)

So I am going to assume you mean cname above.

> But if I run
> Select initcap(name) cname from customers where 1=0 (no records returns)
> If no records return, cname field as "Memo" (like a CLOB) or longvarchar
>
> In my connection string, I am setting B0=254 meaning any strings under 254 chracter should be varchar and over 255 should by longchar type(Memo).
> And any unknown as longchar type(Unknownsizes=2)

Well according to here:

http://psqlodbc.projects.pgfoundry.org/docs/config.html

you should not need to use Unknownsizes for 6.4+ versions of Postgres
or if you do use Maximum.

>
> I cannot find any setting that will return the cname field as a varchar (short char), instead of a longchar type(Memo, CLOB)
>
> Any ideas?
>
> Barry Bell
>

--
Adrian Klaver
adrian(dot)klaver(at)aklaver(dot)com

In response to

Responses

Browse pgsql-odbc by date

  From Date Subject
Next Message Dev Kumkar 2014-05-14 05:23:18 ODBC : SQLGetData question
Previous Message Barry Bell 2014-05-13 14:04:22 psqlODBC text length with no records