Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WkdKj-0003F8-PZ for pgsql-odbc@arkaria.postgresql.org; Wed, 14 May 2014 17:51:13 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1WkdKi-0002tE-7V for pgsql-odbc@arkaria.postgresql.org; Wed, 14 May 2014 17:51:12 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WkYyo-0001xp-FL for pgsql-odbc@postgresql.org; Wed, 14 May 2014 13:12:18 +0000 Received: from mail-bl2on0137.outbound.protection.outlook.com ([65.55.169.137] helo=na01-bl2-obe.outbound.protection.outlook.com) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WkYyh-0006Tj-QT for pgsql-odbc@postgresql.org; Wed, 14 May 2014 13:12:17 +0000 Received: from BY2PR08MB282.namprd08.prod.outlook.com (10.242.237.148) by BY2PR08MB697.namprd08.prod.outlook.com (10.141.141.28) with Microsoft SMTP Server (TLS) id 15.0.944.11; Wed, 14 May 2014 13:12:01 +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:12:00 +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:11:59 +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/2SP6QOaa9NAxMqce9AAWBOuAABmcwZAAAJz2AAAAaKCQ Date: Wed, 14 May 2014 13:11:58 +0000 Message-ID: References: <152de38c9c2544b9b61f9a2f77e9aa3d@BY2PR08MB281.namprd08.prod.outlook.com> <5372B875.3010407@aklaver.com> <3fca930240554b80bc4174911fb49400@BY2PR08MB281.namprd08.prod.outlook.com> <53736874.2090905@aklaver.com> In-Reply-To: <53736874.2090905@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)(189002)(479174003)(13464003)(199002)(24454002)(377454003)(51704005)(38414003)(69234005)(92566001)(83322001)(31966008)(21056001)(4396001)(76576001)(87936001)(85852003)(83072002)(76482001)(46102001)(86362001)(77982001)(15202345003)(64706001)(79102001)(99286001)(101416001)(50986999)(20776003)(99396002)(81342001)(74502001)(74316001)(2656002)(19580405001)(66066001)(33646001)(54356999)(76176999)(19580395003)(15975445006)(80022001)(81542001)(74662001)(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: -1.9 (-) 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 Use the cast work fine but we are using the initcap function in a lot of pl= aces 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.klaver@aklaver.com]=20 Sent: Wednesday, May 14, 2014 8:58 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 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 SQLLongVa= rchar, 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=3D0 > > 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=20=09 So what happens if you cast to varchar?: SELECT initcap('ABCDEF')::varchar vv FROM dual WHERE 1=3D0 > > > --=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