Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WkdM3-0003I5-08 for pgsql-odbc@arkaria.postgresql.org; Wed, 14 May 2014 17:52:35 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1WkdM1-0004iO-JI for pgsql-odbc@arkaria.postgresql.org; Wed, 14 May 2014 17:52:33 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WkZg0-0007s2-Ro for pgsql-odbc@postgresql.org; Wed, 14 May 2014 13:56:56 +0000 Received: from mail-by2lp0236.outbound.protection.outlook.com ([207.46.163.236] helo=na01-by2-obe.outbound.protection.outlook.com) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WkZfv-0007Gd-60 for pgsql-odbc@postgresql.org; Wed, 14 May 2014 13:56:56 +0000 Received: from BY2PR08MB282.namprd08.prod.outlook.com (10.242.237.148) by BY2PR08MB255.namprd08.prod.outlook.com (10.242.40.19) with Microsoft SMTP Server (TLS) id 15.0.939.12; Wed, 14 May 2014 13:56:47 +0000 Received: from BY2PR08MB281.namprd08.prod.outlook.com (10.242.237.145) by BY2PR08MB282.namprd08.prod.outlook.com (10.242.237.148) with Microsoft SMTP Server (TLS) id 15.0.939.12; Wed, 14 May 2014 13:56:43 +0000 Received: from BY2PR08MB281.namprd08.prod.outlook.com ([169.254.7.145]) by BY2PR08MB281.namprd08.prod.outlook.com ([169.254.7.145]) with mapi id 15.00.0939.000; Wed, 14 May 2014 13:56:42 +0000 From: Barry Bell To: Adrian Klaver , Hiroshi Saito , Michael Paquier , "Hiroshi Inoue" CC: Heikki Linnakangas , Anna Gershnik , "pgsql-odbc@postgresql.org" Subject: Re: psqlODBC text length with no records Thread-Topic: [ODBC] psqlODBC text length with no records Thread-Index: Ac9uszh7MQJ/2SP6QOaa9NAxMqce9AAWBOuAABmcwZAAAJz2AAAAaKCQAABwCgAAAA7PoAAA5BUAAAAcmYA= Date: Wed, 14 May 2014 13:56:41 +0000 Message-ID: <14cee66c2d5d444a8ec0c4c773f20d5b@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> <53736E22.4090506@aklaver.com> <53737480.6070808@aklaver.com> In-Reply-To: <53737480.6070808@aklaver.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [63.95.64.254] x-forefront-prvs: 0211965D06 x-forefront-antispam-report: SFV:NSPM; SFS:(10019001)(6009001)(428001)(51704005)(38414003)(479174003)(189002)(199002)(377454003)(24454002)(13464003)(50986999)(99396002)(20776003)(99286001)(101416001)(19580395003)(33646001)(76176999)(54356999)(81542001)(80022001)(74662001)(74316001)(81342001)(74502001)(66066001)(19580405001)(2656002)(21056001)(4396001)(76576001)(87936001)(92566001)(83322001)(31966008)(77982001)(46102001)(86362001)(79102001)(64706001)(83072002)(76482001)(85852003)(24736002); DIR:OUT; SFP:1102; SCL:1; SRVR:BY2PR08MB282; H:BY2PR08MB281.namprd08.prod.outlook.com; FPR:; MLV:sfv; PTR:InfoNoRecords; MX:1; A:1; LANG:en; received-spf: None (: hartehanks.com does not designate permitted sender hosts) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Barry.Bell@hartehanks.com; Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: hartehanks.com X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-odbc Precedence: bulk Sender: pgsql-odbc-owner@postgresql.org My issue is with the output of the ODBC driver. The data type of the output of the ODBC driver changes if you do not have r= ecords. You answers are the data type out of postgres directly without the ODBC dri= ver. You need the run the sql through the ODBC driver (which you said you are no= t). Can someone else try the test sql through the ODBC driver? SELECT initcap(vcharfield) vv FROM table (returns varchar) vs SELECT initcap(vcharfield) vv FROM table WHERE 1=3D0 Returns text 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]=20 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=3D0 > > You link only show the date type in postgres and I am asking about the dr= iver 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 mome= nt. > (Output from the ODBC driver may be different format then for pg admin et= c). > > SELECT initcap('ABCDEF')::varchar vv FROM dual WHERE 1=3D0 I am=20 > expending a "character varying" or "varchar" output from the sql=20 > statement But the I getting the postgres "text" > If the SQL is changed to return records, SELECT=20 > initcap('ABCDEF')::varchar vv FROM dual The output is varchar > > So > SELECT initcap('ABCDEF')::varchar vv FROM dual Works, returns varchar=20 > So the issues is with: > SELECT initcap('ABCDEF')::varchar vv FROM dual WHERE 1=3D0 Returning=20=20 > "text", sqllongvar a different type then above, Does not change with=20 > 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 --=20 Adrian Klaver adrian.klaver@aklaver.com --=20 Sent via pgsql-odbc mailing list (pgsql-odbc@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-odbc