pg.ddx.io  pgsql-odbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Barry Bell <Barry.Bell@hartehanks.com>
To: Adrian Klaver <adrian.klaver@aklaver.com>
To: Hiroshi Saito <hiroshi@winpg.jp>
To: Michael Paquier <michael.paquier@gmail.com>
To: Hiroshi Inoue <inoue@tpf.co.jp>
Cc: Heikki Linnakangas <hlinnakangas@vmware.com>
Cc: Anna Gershnik <agershnik@tableausoftware.com>
Cc: pgsql-odbc@postgresql.org <pgsql-odbc@postgresql.org>
Subject: Re: psqlODBC text length with no records
Date: Wed, 14 May 2014 14:42:36 +0000
Message-ID: <5471c0f731f5413a91c73ea34703a7f0@BY2PR08MB281.namprd08.prod.outlook.com> (raw)
In-Reply-To: <53737480.6070808@aklaver.com>
References: <152de38c9c2544b9b61f9a2f77e9aa3d@BY2PR08MB281.namprd08.prod.outlook.com>
	<5372B875.3010407@aklaver.com>
	<3fca930240554b80bc4174911fb49400@BY2PR08MB281.namprd08.prod.outlook.com>
	<53736874.2090905@aklaver.com>
	<b3d4a6df087c4f238679fd06bfc7493c@BY2PR08MB281.namprd08.prod.outlook.com>
	<53736E22.4090506@aklaver.com>
	<b69daf8c28f741a3ae1206b160aa4a7d@BY2PR08MB281.namprd08.prod.outlook.com>
	<53737480.6070808@aklaver.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-odbc>

Currently, the setting B0=254 on the ODBC driver will,
If the string(text) length is 1-254 characters. returns a "varchar" 
If the string(text) length is over 254 characters. returns a "text"
If the string(text) length is 0 (or null), it return a "text"(Anyway to change this part?)

The driver settings(B0,Unkown size, unkown type, seem to only apply when data is returned,
If no records are returned (with a length of 0 or null), it returns text, no which settings.

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.klaver@aklaver.com] 
Sent: Wednesday, May 14, 2014 9:50 AM
To: Barry Bell; Hiroshi Saito; Michael Paquier; Hiroshi Inoue
Cc: Heikki Linnakangas; Anna Gershnik; pgsql-odbc@postgresql.org
Subject: Re: [ODBC] psqlODBC text length with no records

On 05/14/2014 06:31 AM, Barry Bell wrote:
> I am referring the output of the odbc driver from SQL statement:
> SELECT initcap('ABCDEF')::varchar vv FROM dual WHERE 1=0
>
> You link only show the date type in postgres and I am asking about the driver output.

This is what you asked:

"You said the initcap function return "text", Is this a "short" text like a varchar Or a long text like a clob,memo etc?"

and I answered that question.


> Are you using this statement with the ODBC driver?

No, as I said previously I do not have an ODBC set up available at the moment.

> (Output from the ODBC driver may be different format then for pg admin etc).
>
> SELECT initcap('ABCDEF')::varchar vv FROM dual WHERE 1=0 I am 
> expending a "character varying" or "varchar" output from the sql 
> statement But the I getting the postgres "text"
> If the SQL is changed to return records, SELECT 
> initcap('ABCDEF')::varchar vv FROM dual The output is varchar
>
> So
> SELECT initcap('ABCDEF')::varchar vv FROM dual Works, returns varchar 
> So the issues is with:
> SELECT initcap('ABCDEF')::varchar vv FROM dual WHERE 1=0 Returning  
> "text", sqllongvar a different type then above, Does not change with 
> any unknownsize or datetype setting in ODBC driver.

As I recall this is eventually ending up in a VFP application. So where are you actually seeing the different behavior, in the app or somewhere before the app?

>
> Barry Bell



-- 
Adrian Klaver
adrian.klaver@aklaver.com


-- 
Sent via pgsql-odbc mailing list (pgsql-odbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-odbc



view thread (23+ messages)  latest in thread

Message-ID: <5471c0f731f5413a91c73ea34703a7f0@BY2PR08MB281.namprd08.prod.outlook.com>
Permalink:  ../5471c0f731f5413a91c73ea34703a7f0@BY2PR08MB281.namprd08.prod.outlook.com/
Also on:    postgresql.org/message-id/5471c0f731f5413a91c73ea34703a7f0@BY2PR08MB281.namprd08.prod.outlook.com

 · 

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: Barry.Bell@hartehanks.com, adrian.klaver@aklaver.com, hiroshi@winpg.jp, michael.paquier@gmail.com, inoue@tpf.co.jp, hlinnakangas@vmware.com, agershnik@tableausoftware.com
  Subject: Re: psqlODBC text length with no records
  In-Reply-To: <5471c0f731f5413a91c73ea34703a7f0@BY2PR08MB281.namprd08.prod.outlook.com>
  References: <152de38c9c2544b9b61f9a2f77e9aa3d@BY2PR08MB281.namprd08.prod.outlook.com> <5372B875.3010407@aklaver.com> <3fca930240554b80bc4174911fb49400@BY2PR08MB281.namprd08.prod.outlook.com> <53736874.2090905@aklaver.com> <b3d4a6df087c4f238679fd06bfc7493c@BY2PR08MB281.namprd08.prod.outlook.com> <53736E22.4090506@aklaver.com> <b69daf8c28f741a3ae1206b160aa4a7d@BY2PR08MB281.namprd08.prod.outlook.com> <53737480.6070808@aklaver.com> <5471c0f731f5413a91c73ea34703a7f0@BY2PR08MB281.namprd08.prod.outlook.com>

* 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