<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>Question Re: How do I avoid &amp;quot;Count field incorrect&amp;quot; with a proxy function? in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/how-do-i-avoid-quot-count-field-incorrect-quot-with-a-proxy-function/qaa-p/13835676#M4866519</link>
    <description>&lt;P&gt;By using a newer EBF, methinks...&lt;/P&gt;
&lt;P&gt;See that rather similar question:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;A href="http://sqlanywhere-forum.sap.com/questions/28105"&gt;Remote Function error "Count field incorrect"&lt;/A&gt; and Jack's &lt;A href="http://sqlanywhere-forum.sap.com/questions/28105#28147"&gt;answer&lt;/A&gt;.&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;According to the &lt;A href="http://sqlasupport.sap.com/readme/sqla1704.html#none"&gt;online 17.0.4.2179 EBF readme file&lt;/A&gt;, I guess it has been fixed as CR #802464.&lt;/P&gt;</description>
    <pubDate>Sun, 05 Mar 2017 16:11:48 GMT</pubDate>
    <dc:creator>VolkerBarth</dc:creator>
    <dc:date>2017-03-05T16:11:48Z</dc:date>
    <item>
      <title>How do I avoid "Count field incorrect" with a proxy function?</title>
      <link>https://community.sap.com/t5/technology-q-a/how-do-i-avoid-quot-count-field-incorrect-quot-with-a-proxy-function/qaq-p/13835675</link>
      <description>&lt;P&gt;A simple reference to proxy function using two SQL Anywhere 17.0.4.2100 databases results in a "Count field incorrect" error message.&lt;/P&gt;
&lt;P&gt;In particular, a SQL excerpt looks like this...&lt;/P&gt;
&lt;PRE&gt;CREATE FUNCTION proxy_f_test
   ( IN &lt;A href="http://sqlanywhere-forum.sap.com/users/693/potn1" target="_blank"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/693/potn1" target="_blank"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/693/potn1" target="_blank"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/693/potn1" target="_blank"&gt;@p&lt;/A&gt;   INTEGER )
   RETURNS VARCHAR ( 20 )
   AT 'ddd17a...f_test';

SELECT proxy_f_test ( 1000 );

There was an error reading the results of the SQL statement.
The displayed results may be incorrect or incomplete.
Server 'ddd17a': [SAP][ODBC Driver]Count field incorrect
SQLCODE=-660, ODBC 3 State="HY000"
&lt;/PRE&gt;

&lt;P&gt;and an excerpt from the "SET OPTION PUBLIC.cis_option = 7" output looks like this:&lt;/P&gt;
&lt;PRE&gt;I. 03/05 09:18:46. Execute RPC (ddd17a): {? = CALL "f_test"(?)}
I. 03/05 09:18:46. ODBC error (07002). [SAP][ODBC Driver]Count field incorrect
&lt;/PRE&gt;

&lt;P&gt;The &lt;B&gt;&lt;A href="http://dcx.sap.com/index.html#sqla170/en/html/80de27b96ce21014b99bce6a1c2057f9.html" target="_blank"&gt;SQLSTATE 07002 is described here&lt;/A&gt;&lt;/B&gt;: You have not provided enough host variables for either the number of bind variables, or the statement, or the number of SELECT list items.&lt;/P&gt;
&lt;P&gt;The full reproducible follows...&lt;/P&gt;
&lt;PRE&gt;REM Test setup

"%SQLANY17%\\bin64\\dbinit.exe"^
  -dba dba,sql^
  -mpl 3^
  ddd17a.db

"%SQLANY17%\\bin64\\dbspawn.exe"^
  -f "%SQLANY17%\\bin64\\dbsrv17.exe"^
  -o dbsrv17_log_ddd17a.txt^
  ddd17a.db 

"%SQLANY17%\\bin64\\dbisql.com"^
  -c "ENG=ddd17a; DBN=ddd17a; UID=dba; PWD=sql; CON=ddd17a-1"

"%SQLANY17%\\bin64\\dbinit.exe"^
  -dba dba,sql^
  -mpl 3^
  ddd17b.db

"%SQLANY17%\\bin64\\dbspawn.exe"^
  -f "%SQLANY17%\\bin64\\dbsrv17.exe"^
  -o dbsrv17_log_ddd17b.txt^
  ddd17b.db 

"%SQLANY17%\\bin64\\dbisql.com"^
  -c "ENG=ddd17b; DBN=ddd17b; UID=dba; PWD=sql; CON=ddd17b-1"
&lt;/PRE&gt;

&lt;PRE&gt;---------------------------------
-- Connection ddd17a-1  -  master

BEGIN
   DROP FUNCTION f_test
   EXCEPTION WHEN OTHERS THEN
END;

CREATE FUNCTION f_test
   ( IN &lt;A href="http://sqlanywhere-forum.sap.com/users/693/potn1" target="_blank"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/693/potn1" target="_blank"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/693/potn1" target="_blank"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/693/potn1" target="_blank"&gt;@p&lt;/A&gt;   INTEGER )
   RETURNS VARCHAR ( 20 )
BEGIN
   RETURN STRING ( &lt;A href="http://sqlanywhere-forum.sap.com/users/693/potn1" target="_blank"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/693/potn1" target="_blank"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/693/potn1" target="_blank"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/693/potn1" target="_blank"&gt;@p&lt;/A&gt;, 'ms' );
END;

---------------------------------
-- Connection ddd17b-1  -  client

BEGIN
   DROP FUNCTION proxy_f_test
   EXCEPTION WHEN OTHERS THEN
END;

BEGIN  
   DROP EXTERNLOGIN dba TO ddd17a;
   EXCEPTION WHEN OTHERS THEN
END;

BEGIN
   DROP SERVER ddd17a;
   EXCEPTION WHEN OTHERS THEN
END;

SET OPTION PUBLIC.cis_option = 7;

CREATE SERVER ddd17a CLASS 'SAODBC' 
   USING 'DRIVER=SQL Anywhere Native; ENG=ddd17a; DBN=ddd17a; UID=dba; PWD=sql;';

CREATE EXTERNLOGIN DBA
   TO ddd17a 
   REMOTE LOGIN "dba" IDENTIFIED BY 'sql';

CREATE FUNCTION proxy_f_test
   ( IN &lt;A href="http://sqlanywhere-forum.sap.com/users/693/potn1" target="_blank"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/693/potn1" target="_blank"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/693/potn1" target="_blank"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/693/potn1" target="_blank"&gt;@p&lt;/A&gt;   INTEGER )
   RETURNS VARCHAR ( 20 )
   AT 'ddd17a...f_test';

SELECT proxy_f_test ( 1000 );

There was an error reading the results of the SQL statement.
The displayed results may be incorrect or incomplete.
Server 'ddd17a': [SAP][ODBC Driver]Count field incorrect
SQLCODE=-660, ODBC 3 State="HY000"
&lt;/PRE&gt;

&lt;P&gt;The console log (dbsrv17 -o dbsrv17_log_ddd17b.txt) looks like this&lt;/P&gt;
&lt;PRE&gt;I. 03/05 09:17:47. SQL Anywhere Network Server Version 17.0.4.2100 I. 03/05 09:17:47. Developer edition, not licensed for deployment.
I. 03/05 09:17:47.  I. 03/05 09:17:47. Copyright © 2016 SAP SE or an SAP affiliate company.
I. 03/05 09:17:47. All rights reserved.
I. 03/05 09:17:47. Use of this software is governed by the SAP Software Use Rights Agreement.
I. 03/05 09:17:47. Refer to &lt;A href="http://global.sap.com/corporate-en/our-company/agreements/index.epx." target="_blank"&gt;http://global.sap.com/corporate-en/our-company/agreements/index.epx.&lt;/A&gt;
I. 03/05 09:17:47.  I. 03/05 09:17:47. Processors detected: 8 logical processor(s) on 4 core(s) on 1 physical processor(s)
I. 03/05 09:17:47. Processor license restriction (licensed processors): all logical processors on at most 8 core(s) on any number of physical processors
I. 03/05 09:17:47. This server is licensed to use: all logical processors on at most 8 core(s) on any number of physical processors
I. 03/05 09:17:47. Processors in use by server: 8 logical processor(s) on 4 core(s) on 1 physical processor(s)
I. 03/05 09:17:47. This server is licensed to:
I. 03/05 09:17:47.     Developer Edition
I. 03/05 09:17:47.     Restricted Use
I. 03/05 09:17:47. Running Windows 7 Build 7601 Service Pack 1 on X86_64
I. 03/05 09:17:47. Server built for X86_64 processor architecture
I. 03/05 09:17:47. 51968K of memory used for caching
I. 03/05 09:17:47. Minimum cache size: 51192K, maximum cache size: 15050852K
I. 03/05 09:17:47. Using a maximum page size of 4096 bytes
I. 03/05 09:17:47. Multiprogramming level: minimum:8, current:20, maximum:80
I. 03/05 09:17:47. Automatic tuning of multiprogramming level is enabled
I. 03/05 09:17:47. Starting database "ddd17b" (C:\\projects\\foxhound5\\test\\040 volume tests\\11 Three Foxhounds with 10 target databases each, each of which has 10 connections\\problem_with_proxy_function\\ddd17b.db) at Sun Mar 05 2017 09:17
I. 03/05 09:17:47. Performance warning: Database file "C:\\projects\\foxhound5\\test\\040 volume tests\\11 Three Foxhounds with 10 target databases each, each of which has 10 connections\\problem_with_proxy_function\\ddd17b.db" consists of 16 disk fragments
I. 03/05 09:17:48. Transaction log: ddd17b.log
I. 03/05 09:17:48. Starting checkpoint of "ddd17b" (ddd17b.db) at Sun Mar 05 2017 09:17
I. 03/05 09:17:48. Finished checkpoint of "ddd17b" (ddd17b.db) at Sun Mar 05 2017 09:17
I. 03/05 09:17:48. Database "ddd17b" (ddd17b.db) started at Sun Mar 05 2017 09:17
I. 03/05 09:17:48. Database server started at Sun Mar 05 2017 09:17
I. 03/05 09:17:48. Trying to start SharedMemory link ...
I. 03/05 09:17:48.     SharedMemory link started successfully
I. 03/05 09:17:48. Trying to start TCPIP link ...
I. 03/05 09:17:48. Unable to start on default port; starting on port 49180 instead
I. 03/05 09:17:53.     TCPIP link started successfully
I. 03/05 09:17:53. Now accepting requests
I. 03/05 09:17:56. Cache size adjusted to 51192K
I. 03/05 09:18:46. Connect to 'ddd17a' class 'saodbc' using 'DRIVER=SQL Anywhere Native; ENG=ddd17a; DBN=ddd17a; UID=dba; PWD=sql;'
I. 03/05 09:18:46. Connected to 'dbodbc17.dll' version '17.00.2100' odbc version '03.52'
I. 03/05 09:18:46. Server name = 'ddd17a'
I. 03/05 09:18:46. DBMS name = 'SQL Anywhere'
I. 03/05 09:18:46. DBMS version = '17.00.0004'
I. 03/05 09:18:46. ODBC conformance = level 2
I. 03/05 09:18:46. ODBC SQL conformance = Extended grammar
I. 03/05 09:18:46. SQL identifier case = Case insensitive
I. 03/05 09:18:46. Maximum connections = 0
I. 03/05 09:18:46. Maximum statements = 0
I. 03/05 09:18:46. SQLGetData extensions = any column, any row, any order 
I. 03/05 09:18:46. Search pattern escape = '~'
I. 03/05 09:18:46. Concatenation null behavior = SQL_CB_NON_NULL
I. 03/05 09:18:46. Cursor commit behavior = SQL_CC_PRESERVE
I. 03/05 09:18:46. Cursor rollback behavior = SQL_CR_PRESERVE
I. 03/05 09:18:46. Cursor types = value concurrency, rowver concurrency, locking concurrency, read only 
I. 03/05 09:18:46. Read only datasource = 'N'
I. 03/05 09:18:46. Correlation names are supported
I. 03/05 09:18:46. Transactions that contain DDL are automatically committed
I. 03/05 09:18:46. Default isolation = read uncommitted 
I. 03/05 09:18:46. Multiple result sets = 'Y'
I. 03/05 09:18:46. Multiple transactions = 'Y'
I. 03/05 09:18:46. Isolation options = serializable, repeatable read, read committed, read uncommitted 
I. 03/05 09:18:46. Outer join capabilities = inner, not ordered, all comparison ops, nested, full, right, left 
I. 03/05 09:18:46. Maximum owner name length = 128
I. 03/05 09:18:46. Maximum qualifier name length = 0
I. 03/05 09:18:46. Maximum table name length = 128
I. 03/05 09:18:46. Execute RPC (ddd17a): {? = CALL "f_test"(?)}
I. 03/05 09:18:46. ODBC error (07002). [SAP][ODBC Driver]Count field incorrect
&lt;/PRE&gt;</description>
      <pubDate>Sun, 05 Mar 2017 09:32:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/how-do-i-avoid-quot-count-field-incorrect-quot-with-a-proxy-function/qaq-p/13835675</guid>
      <dc:creator>Breck_Carter</dc:creator>
      <dc:date>2017-03-05T09:32:38Z</dc:date>
    </item>
    <item>
      <title>Re: How do I avoid "Count field incorrect" with a proxy function?</title>
      <link>https://community.sap.com/t5/technology-q-a/how-do-i-avoid-quot-count-field-incorrect-quot-with-a-proxy-function/qaa-p/13835676#M4866519</link>
      <description>&lt;P&gt;By using a newer EBF, methinks...&lt;/P&gt;
&lt;P&gt;See that rather similar question:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;A href="http://sqlanywhere-forum.sap.com/questions/28105"&gt;Remote Function error "Count field incorrect"&lt;/A&gt; and Jack's &lt;A href="http://sqlanywhere-forum.sap.com/questions/28105#28147"&gt;answer&lt;/A&gt;.&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;According to the &lt;A href="http://sqlasupport.sap.com/readme/sqla1704.html#none"&gt;online 17.0.4.2179 EBF readme file&lt;/A&gt;, I guess it has been fixed as CR #802464.&lt;/P&gt;</description>
      <pubDate>Sun, 05 Mar 2017 16:11:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/how-do-i-avoid-quot-count-field-incorrect-quot-with-a-proxy-function/qaa-p/13835676#M4866519</guid>
      <dc:creator>VolkerBarth</dc:creator>
      <dc:date>2017-03-05T16:11:48Z</dc:date>
    </item>
    <item>
      <title>Re: How do I avoid "Count field incorrect" with a proxy function?</title>
      <link>https://community.sap.com/t5/technology-q-a/how-do-i-avoid-quot-count-field-incorrect-quot-with-a-proxy-function/qaa-p/13835677#M4866520</link>
      <description>&lt;P&gt;Yes, indeed, that answer is exactly correct.&lt;/P&gt;
&lt;P&gt;Tests with SQL Anywhere 16.0.0.2344 EBF and 17.0.6.2806 EBF ( note the point-six !!! ) show the code now works...&lt;/P&gt;
&lt;PRE&gt;SELECT @@VERSION, proxy_f_test ( 1000 );

@@VERSION,proxy_f_test(1000)
'16.0.0.2344','1000ms'

@@VERSION,proxy_f_test(1000)
'17.0.6.2806','1000ms'
&lt;/PRE&gt;</description>
      <pubDate>Mon, 06 Mar 2017 07:58:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/how-do-i-avoid-quot-count-field-incorrect-quot-with-a-proxy-function/qaa-p/13835677#M4866520</guid>
      <dc:creator>Breck_Carter</dc:creator>
      <dc:date>2017-03-06T07:58:44Z</dc:date>
    </item>
  </channel>
</rss>

