Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WkYld-0008CH-3j for pgsql-odbc@arkaria.postgresql.org; Wed, 14 May 2014 12:58:41 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1WkYlc-00088E-7g for pgsql-odbc@arkaria.postgresql.org; Wed, 14 May 2014 12:58:40 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WkYlb-000885-68 for pgsql-odbc@postgresql.org; Wed, 14 May 2014 12:58:39 +0000 Received: from out1-smtp.messagingengine.com ([66.111.4.25]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WkYlW-0006Dh-MB for pgsql-odbc@postgresql.org; Wed, 14 May 2014 12:58:38 +0000 Received: from compute1.internal (compute1.nyi.mail.srv.osa [10.202.2.41]) by gateway1.nyi.mail.srv.osa (Postfix) with ESMTP id 7760420C0E for ; Wed, 14 May 2014 08:58:30 -0400 (EDT) Received: from frontend1 ([10.202.2.160]) by compute1.internal (MEProxy); Wed, 14 May 2014 08:58:30 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=aklaver.com; h= message-id:date:from:mime-version:to:cc:subject:references :in-reply-to:content-type:content-transfer-encoding; s=mesmtp; bh=HAM1lSRhNFHAV4weI9Ti8fHZEl4=; b=V8XzS7z9eRdjPbQJtCrnR5OsCS8G 998g+WEKnqYvt1H65MnXxhmPHjkSSyDFU5vy9H9Qspd887eQrweMFIUgEyyYMVhw mwuF+GVVJe6XenvoQpeyoOsCJGnK5CUp2lby/vdaA8q1wkR1SOOpd5vWd9o3UvL6 LWLElvsZmGLYhy8= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=message-id:date:from:mime-version:to:cc :subject:references:in-reply-to:content-type :content-transfer-encoding; s=smtpout; bh=HAM1lSRhNFHAV4weI9Ti8f HZEl4=; b=fw5PKfnqmr1EBRbbzcsS9ptU50qo8KwqJtFcXfzh2c/YL0X0FeU+A+ 3jniYfSvBRz0YGgr3IHFFY76050nWimJqf4lcN8qZMCc8LOqdqlmTC/y4SJG9PJy a1f5k62KEPrgFXm5NkKXNrF82mxyw2RxGFWGX+6pIW769teMdgaLE= X-Sasl-enc: po+cA7vD3sYUvbsUsT5dzxezpVEz8lhcSK0g8MtwXDpc 1400072310 Received: from panda.site (unknown [65.102.186.57]) by mail.messagingengine.com (Postfix) with ESMTPA id 78945C007B3; Wed, 14 May 2014 08:58:29 -0400 (EDT) Message-ID: <53736874.2090905@aklaver.com> Date: Wed, 14 May 2014 05:58:28 -0700 From: Adrian Klaver User-Agent: Mozilla/5.0 (X11; Linux i686; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: Barry Bell , Hiroshi Saito , Michael Paquier , Hiroshi Inoue CC: Heikki Linnakangas , Anna Gershnik , "pgsql-odbc@postgresql.org" Subject: Re: psqlODBC text length with no records References: <152de38c9c2544b9b61f9a2f77e9aa3d@BY2PR08MB281.namprd08.prod.outlook.com> <5372B875.3010407@aklaver.com> <3fca930240554b80bc4174911fb49400@BY2PR08MB281.namprd08.prod.outlook.com> In-Reply-To: <3fca930240554b80bc4174911fb49400@BY2PR08MB281.namprd08.prod.outlook.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -2.7 (--) 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 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.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