Re: psqlODBC text length with no records - Mailing list pgsql-odbc

From Adrian Klaver
Subject Re: psqlODBC text length with no records
Date
Msg-id 5372B875.3010407@aklaver.com
Whole thread Raw
In response to psqlODBC text length with no records  (Barry Bell <Barry.Bell@hartehanks.com>)
Responses Re: psqlODBC text length with no records
List 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
shouldby 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.klaver@aklaver.com


pgsql-odbc by date:

Previous
From: Barry Bell
Date:
Subject: psqlODBC text length with no records
Next
From: Dev Kumkar
Date:
Subject: ODBC : SQLGetData question