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 12:58:28
Message-ID: 53736874.2090905@aklaver.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-odbc

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

In response to

Responses

Browse pgsql-odbc by date

  From Date Subject
Next Message Barry Bell 2014-05-14 13:11:58 Re: psqlODBC text length with no records
Previous Message Barry Bell 2014-05-14 12:51:14 Re: psqlODBC text length with no records