Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1ZK7vK-0000d4-S7 for pgsql-odbc@arkaria.postgresql.org; Tue, 28 Jul 2015 16:40:14 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1ZK7vK-0000sb-3s for pgsql-odbc@arkaria.postgresql.org; Tue, 28 Jul 2015 16:40:14 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1ZJyDb-0006bt-8i for pgsql-odbc@postgresql.org; Tue, 28 Jul 2015 06:18:27 +0000 Received: from cdptpa-outbound-snat.email.rr.com ([107.14.166.229] helo=cdptpa-oedge-vip.email.rr.com) by magus.postgresql.org with esmtp (Exim 4.84) (envelope-from ) id 1ZJyDW-0004Ev-Ss for pgsql-odbc@postgresql.org; Tue, 28 Jul 2015 06:18:26 +0000 Received: from [66.27.108.254] ([66.27.108.254:6178] helo=NORTHPENNSYLVAN.intuii.local) by cdptpa-oedge02 (envelope-from ) (ecelerity 3.5.0.35861 r(Momo-dev:tip)) with ESMTP id 63/6B-27817-9AE17B55; Tue, 28 Jul 2015 06:18:18 +0000 Received: from NewCalifornia (66.27.108.254) by NORTHPENNSYLVAN.intuii.local (10.5.0.120) with Microsoft SMTP Server id 14.1.438.0; Mon, 27 Jul 2015 23:18:07 -0700 From: "Jens Sorensen (Intuii)" To: 'Adrian Klaver' , References: <4854fc01d0c6cb$fc0c0010$f4240030$@Intuii.com> <55B656AD.6020800@aklaver.com> <8FB820A2-C966-42A5-B5D2-BA4BA7170BC3@Intuii.com> <55B6609A.7070108@aklaver.com> In-Reply-To: <55B6609A.7070108@aklaver.com> Subject: Re: PSQLODBC.DLL - The (maximum) expected data length is 8000, while the returned data length is 9606. Date: Mon, 27 Jul 2015 23:18:37 -0700 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Outlook 15.0 Content-Language: en-us Thread-Index: AQFdXfJGKPzmMOG2VIHjfxzBfarCHgIT7Bt0AZVD/iABXrWjR56u+UJA X-Originating-IP: [66.27.108.254] X-RR-Connecting-IP: 107.14.168.130:25 X-Cloudmark-Score: 0 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 Thanks, I've replaced the 'text' column.=20 Here is the error messages when I use 'varchar(max)': =20 Msg 7347, Level 16, State 1, Procedure RetrieveHttpEvents, Line 18 OLE DB provider 'MSDASQL' for linked server '(null)' returned data that doe= s not match expected data length for column '[MSDASQL].uri'. The (maximum) = expected data length is 8000, while the returned data length is 9606. And here is the error messages when I use 'varchar(max)': Msg 7347, Level 16, State 1, Procedure RetrieveHttpEvents, Line 18 OLE DB provider 'MSDASQL' for linked server '(null)' returned data that doe= s not match expected data length for column '[MSDASQL].uri'. The (maximum) = expected data length is 8000, while the returned data length is 9606. So unfortunately this does not appear to have made a difference. Here is my current query on SQL Server: INSERT http_events=20 SELECT * FROM openrowset ( 'MSDASQL', 'Dsn=3DPostgreSQL35W;',=20 'Select=20=20=20 event_id, time_stamp, session_id, client_intf, server_intf, c_client_addr, s_client_addr, c_server_addr, s_server_addr, c_client_port, s_client_port, c_server_port, s_server_port, policy_id, username, hostname, request_id, method, uri, host, c2s_content_length, s2c_content_length, s2c_content_type, adblocker_blocked, adblocker_cookie_ident, adblocker_action, webfilter_reason, webfilter_category,=20 webfilter_blocked, webfilter_flagged, sitefilter_reason, sitefilter_category, sitefilter_blocked, sitefilter_flagged, clam_clean, clam_name, virusblocker_clean, virusblocker_name FROM reports.http_events AS log' ) What additional information can I provide you that would be useful? -----Original Message----- From: Adrian Klaver [mailto:adrian.klaver@aklaver.com]=20 Sent: Monday, July 27, 2015 9:47 AM To: Jens Sorensen ; pgsql-odbc@postgresql.org Subject: Re: [ODBC] PSQLODBC.DLL - The (maximum) expected data length is 80= 00, while the returned data length is 9606. On 07/27/2015 09:16 AM, Jens Sorensen wrote: > Hmm when I inserted the values into a table I believe it produced a=20 > column of nvarchar(4000). 4000 appears to be the max for nvarchar in=20 > SQL Server. However I changed the table to use type text instead, and=20 > it did not appear to affect the error message any. First, as I understand it text is deprecated in SQL Server: https://msdn.microsoft.com/en-us/library/ms187993.aspx The 8000 limit you are hitting is seems to the upper limit of SQL Server varchar() unless you specify max: https://msdn.microsoft.com/en-us/library/ms176089.aspx So I wonder if somewhere along the line varchar(8000) is being substituted = for text()? This will need a more detailed description of what you are doing to answer. -- 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