From: | Barry Bell <Barry(dot)Bell(at)hartehanks(dot)com> |
---|---|
To: | Adrian Klaver <adrian(dot)klaver(at)aklaver(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 13:11:58 |
Message-ID: | b3d4a6df087c4f238679fd06bfc7493c@BY2PR08MB281.namprd08.prod.outlook.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-odbc |
Use the cast work fine but we are using the initcap function in a lot of places
And do not want to cast to every place.
(Plus we use a lot of other functions that may have the same issue).
You said the initcap function return "text",
Is this a "short" text like a varchar
Or a long text like a clob,memo etc?
Barry Bell
Senior Developer/Analyst
Logistics
Harte Hanks
1525 NW 3rd ST
Deerfield Beach FL, 33442
954-429-3771 Ext 267 office
954-281-1464 fax
hartehanks.com / linkedin / twitter / facebook
-----Original Message-----
From: Adrian Klaver [mailto:adrian(dot)klaver(at)aklaver(dot)com]
Sent: Wednesday, May 14, 2014 8:58 AM
To: Barry Bell; Hiroshi Saito; Michael Paquier; Hiroshi Inoue
Cc: Heikki Linnakangas; Anna Gershnik; pgsql-odbc(at)postgresql(dot)org
Subject: Re: [ODBC] psqlODBC text length with no records
On 05/14/2014 05:51 AM, Barry Bell wrote:
> Tried every setting for unknown size
> Abd every settubg fir date tyoe options.
> and it always comes back as SQllongvarchar (Memo, CLOB).
>
> The " Text as LongVarChar: PostgreSQL TEXT type is mapped to SQLLongVarchar, otherwise SQLVarchar." Is not working when no records are returned
>
> It will work if the initcap function is not used.
>
> Try it yourself with this sql statement:
>
> SELECT initcap('ABCDEF') vv FROM dual WHERE 1=0
>
> Will return the a sqlongvarchar(Memo,CLOB)
I do not have an ODBC test set up available right now.
FYI initcap returns TEXT:
http://www.postgresql.org/docs/9.3/interactive/functions-string.html
initcap(string) text
So what happens if you cast to varchar?:
SELECT initcap('ABCDEF')::varchar vv FROM dual WHERE 1=0
>
>
>
--
Adrian Klaver
adrian(dot)klaver(at)aklaver(dot)com
From | Date | Subject | |
---|---|---|---|
Next Message | Adrian Klaver | 2014-05-14 13:22:42 | Re: psqlODBC text length with no records |
Previous Message | Adrian Klaver | 2014-05-14 12:58:28 | Re: psqlODBC text length with no records |