<?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: SQL error using sqlanywhere php API sasql_query() in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/sql-error-using-sqlanywhere-php-api-sasql-query/qaa-p/13849297#M4880140</link>
    <description>&lt;P&gt;Have you reviewed the following doc section regarding user-defined database options? The SQL Anywhere error is suggesting that the user-defined option cannot be found.&lt;/P&gt;
&lt;HR /&gt;
&lt;P&gt;[From: &lt;A href="http://dcx.sybase.com/index.html#1201/en/dbreference/set-option-statement.html"&gt;&lt;/A&gt;&lt;A href="http://dcx.sybase.com/index.html#1201/en/dbreference/set-option-statement.html"&gt;&lt;/A&gt;&lt;A href="http://dcx.sybase.com/index.html#1201/en/dbreference/set-option-statement.html"&gt;http://dcx.sybase.com/index.html#1201/en/dbreference/set-option-statement.html&lt;/A&gt; ]&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;User-defined options&lt;/STRONG&gt;
Any option, whether user-defined or not, &lt;EM&gt;must have a public setting before a user-specific value can be assigned&lt;/EM&gt;. The database server does not support setting TEMPORARY values for user-defined options. For example, to create a user-defined option named ApplicationControl, you first issue the statement:&lt;/P&gt;
&lt;DIV class="codehilite"&gt;&lt;PRE&gt;&lt;SPAN class="k"&gt;SET&lt;/SPAN&gt; &lt;SPAN class="k"&gt;OPTION&lt;/SPAN&gt; &lt;SPAN class="k"&gt;PUBLIC&lt;/SPAN&gt;&lt;SPAN class="p"&gt;.&lt;/SPAN&gt;&lt;SPAN class="n"&gt;ApplicationControl&lt;/SPAN&gt; &lt;SPAN class="o"&gt;=&lt;/SPAN&gt; &lt;SPAN class="s1"&gt;'Default'&lt;/SPAN&gt;&lt;SPAN class="p"&gt;;&lt;/SPAN&gt;
&lt;/PRE&gt;&lt;/DIV&gt;


&lt;P&gt;This statement sets the ApplicationControl option to Default for all users, and takes effect with each new connection to the server. Subsequently, an individual user may establish their own setting for this option by issuing a separate SET OPTION statement.&lt;/P&gt;
&lt;HR /&gt;
&lt;P&gt;Have you tried connecting with a 'known' application (e.g. DBISQL) to define the public option first, then trying to change the public option from your application? Also remember that "PUBLIC" settings are only set when first connecting to the database server, and both PHP and .NET offer features regarding &lt;A href="http://dcx.sybase.com/index.html#1201/en/dbprogramming/php-pconnect.html"&gt;persistent connections&lt;/A&gt; or &lt;A href="http://dcx.sybase.com/index.html#1201/en/dbprogramming/connection-pooling-dotnet-dev.html"&gt;connection pooling&lt;/A&gt;, so you should check the PUBLIC option setting after making sure your application has disconnected and reconnected.&lt;/P&gt;</description>
    <pubDate>Tue, 04 Oct 2011 14:59:50 GMT</pubDate>
    <dc:creator>jeff_albion</dc:creator>
    <dc:date>2011-10-04T14:59:50Z</dc:date>
    <item>
      <title>SQL error using sqlanywhere php API sasql_query()</title>
      <link>https://community.sap.com/t5/technology-q-a/sql-error-using-sqlanywhere-php-api-sasql-query/qaq-p/13849296</link>
      <description>&lt;P&gt;I'm having problem executing a specific query using php API from sqlanywhere 12.&lt;/P&gt;
&lt;P&gt;It only happens with SET OPTION query.&lt;/P&gt;
&lt;DIV class="codehilite"&gt;&lt;PRE&gt;&lt;SPAN class="cp"&gt;&amp;lt;?php&lt;/SPAN&gt;
    &lt;SPAN class="c1"&gt;// setup omitted for clarity here&lt;/SPAN&gt;
    &lt;SPAN class="nv"&gt;$result&lt;/SPAN&gt; &lt;SPAN class="o"&gt;=&lt;/SPAN&gt; &lt;SPAN class="nx"&gt;sasql_query&lt;/SPAN&gt;&lt;SPAN class="p"&gt;(&lt;/SPAN&gt; &lt;SPAN class="nv"&gt;$conn&lt;/SPAN&gt;&lt;SPAN class="p"&gt;,&lt;/SPAN&gt; &lt;SPAN class="s2"&gt;"SET OPTION PUBLIC.AjusteFuso = '0'"&lt;/SPAN&gt; &lt;SPAN class="p"&gt;);&lt;/SPAN&gt;
    &lt;SPAN class="c1"&gt;// clean up omitted for clarity here&lt;/SPAN&gt;
&lt;SPAN class="cp"&gt;?&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="x"&gt;&lt;/SPAN&gt;
&lt;/PRE&gt;&lt;/DIV&gt;


&lt;P&gt;I receive the following exception:&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;'AjusteFuso' is an unknown option SET OPTION PUBLIC.AjusteFuso = '0'&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;But this is not true, it is known option in my database!&lt;/P&gt;
&lt;P&gt;1 - others select/update/delete/insert works normal as expected.&lt;/P&gt;
&lt;P&gt;2 - SET OPTION works ok if i test it using sybase central.&lt;/P&gt;
&lt;P&gt;This same query was working normal using sql anywhere 9 with &lt;STRONG&gt;sybase_query()&lt;/STRONG&gt; old API.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;EDIT:&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;I did the same SQL command using .net API and it does not work too.&lt;/P&gt;
&lt;P&gt;SACommand sql = new SACommand("SET OPTION AjusteFuso = 10", conn);
conn.Open();
Console.WriteLine(sql.ExecuteNonQuery());&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt; EDIT 2 &lt;/STRONG&gt;
Correction: in .net API DOES WORKS. I was doing wrong test.&lt;/P&gt;</description>
      <pubDate>Mon, 03 Oct 2011 16:19:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sql-error-using-sqlanywhere-php-api-sasql-query/qaq-p/13849296</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-10-03T16:19:26Z</dc:date>
    </item>
    <item>
      <title>Re: SQL error using sqlanywhere php API sasql_query()</title>
      <link>https://community.sap.com/t5/technology-q-a/sql-error-using-sqlanywhere-php-api-sasql-query/qaa-p/13849299#M4880142</link>
      <description>&lt;P&gt;Is this user-defined option already existing (i.e. shown when selecing from SYSOPTION)?&lt;/P&gt;
&lt;P&gt;And does the error also appear when using &lt;EM&gt;sasql_real_query&lt;/EM&gt;?&lt;/P&gt;</description>
      <pubDate>Mon, 03 Oct 2011 18:19:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sql-error-using-sqlanywhere-php-api-sasql-query/qaa-p/13849299#M4880142</guid>
      <dc:creator>VolkerBarth</dc:creator>
      <dc:date>2011-10-03T18:19:08Z</dc:date>
    </item>
    <item>
      <title>Re: SQL error using sqlanywhere php API sasql_query()</title>
      <link>https://community.sap.com/t5/technology-q-a/sql-error-using-sqlanywhere-php-api-sasql-query/qaa-p/13849300#M4880143</link>
      <description>&lt;P&gt;Yes, it is user defined.&lt;/P&gt;
&lt;P&gt;Yes, does also appears in sasql_real_query too.&lt;/P&gt;
&lt;P&gt;I'm still looking for a solution. No clues yet.&lt;/P&gt;</description>
      <pubDate>Tue, 04 Oct 2011 07:35:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sql-error-using-sqlanywhere-php-api-sasql-query/qaa-p/13849300#M4880143</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-10-04T07:35:33Z</dc:date>
    </item>
    <item>
      <title>Re: SQL error using sqlanywhere php API sasql_query()</title>
      <link>https://community.sap.com/t5/technology-q-a/sql-error-using-sqlanywhere-php-api-sasql-query/qaa-p/13849301#M4880144</link>
      <description>&lt;P&gt;Can you change a known, public option (for example, optimization_level) with the same code? Or does this too give an error?&lt;/P&gt;</description>
      <pubDate>Tue, 04 Oct 2011 10:08:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sql-error-using-sqlanywhere-php-api-sasql-query/qaa-p/13849301#M4880144</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-10-04T10:08:47Z</dc:date>
    </item>
    <item>
      <title>Re: SQL error using sqlanywhere php API sasql_query()</title>
      <link>https://community.sap.com/t5/technology-q-a/sql-error-using-sqlanywhere-php-api-sasql-query/qaa-p/13849297#M4880140</link>
      <description>&lt;P&gt;Have you reviewed the following doc section regarding user-defined database options? The SQL Anywhere error is suggesting that the user-defined option cannot be found.&lt;/P&gt;
&lt;HR /&gt;
&lt;P&gt;[From: &lt;A href="http://dcx.sybase.com/index.html#1201/en/dbreference/set-option-statement.html"&gt;&lt;/A&gt;&lt;A href="http://dcx.sybase.com/index.html#1201/en/dbreference/set-option-statement.html"&gt;&lt;/A&gt;&lt;A href="http://dcx.sybase.com/index.html#1201/en/dbreference/set-option-statement.html"&gt;http://dcx.sybase.com/index.html#1201/en/dbreference/set-option-statement.html&lt;/A&gt; ]&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;User-defined options&lt;/STRONG&gt;
Any option, whether user-defined or not, &lt;EM&gt;must have a public setting before a user-specific value can be assigned&lt;/EM&gt;. The database server does not support setting TEMPORARY values for user-defined options. For example, to create a user-defined option named ApplicationControl, you first issue the statement:&lt;/P&gt;
&lt;DIV class="codehilite"&gt;&lt;PRE&gt;&lt;SPAN class="k"&gt;SET&lt;/SPAN&gt; &lt;SPAN class="k"&gt;OPTION&lt;/SPAN&gt; &lt;SPAN class="k"&gt;PUBLIC&lt;/SPAN&gt;&lt;SPAN class="p"&gt;.&lt;/SPAN&gt;&lt;SPAN class="n"&gt;ApplicationControl&lt;/SPAN&gt; &lt;SPAN class="o"&gt;=&lt;/SPAN&gt; &lt;SPAN class="s1"&gt;'Default'&lt;/SPAN&gt;&lt;SPAN class="p"&gt;;&lt;/SPAN&gt;
&lt;/PRE&gt;&lt;/DIV&gt;


&lt;P&gt;This statement sets the ApplicationControl option to Default for all users, and takes effect with each new connection to the server. Subsequently, an individual user may establish their own setting for this option by issuing a separate SET OPTION statement.&lt;/P&gt;
&lt;HR /&gt;
&lt;P&gt;Have you tried connecting with a 'known' application (e.g. DBISQL) to define the public option first, then trying to change the public option from your application? Also remember that "PUBLIC" settings are only set when first connecting to the database server, and both PHP and .NET offer features regarding &lt;A href="http://dcx.sybase.com/index.html#1201/en/dbprogramming/php-pconnect.html"&gt;persistent connections&lt;/A&gt; or &lt;A href="http://dcx.sybase.com/index.html#1201/en/dbprogramming/connection-pooling-dotnet-dev.html"&gt;connection pooling&lt;/A&gt;, so you should check the PUBLIC option setting after making sure your application has disconnected and reconnected.&lt;/P&gt;</description>
      <pubDate>Tue, 04 Oct 2011 14:59:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sql-error-using-sqlanywhere-php-api-sasql-query/qaa-p/13849297#M4880140</guid>
      <dc:creator>jeff_albion</dc:creator>
      <dc:date>2011-10-04T14:59:50Z</dc:date>
    </item>
    <item>
      <title>Re: SQL error using sqlanywhere php API sasql_query()</title>
      <link>https://community.sap.com/t5/technology-q-a/sql-error-using-sqlanywhere-php-api-sasql-query/qaa-p/13849302#M4880145</link>
      <description>&lt;P&gt;Well, in the question he &lt;EM&gt;does&lt;/EM&gt; use the "SET OPTION PUBLIC.MyOption" syntax and has verified the user-defined option &lt;EM&gt;does&lt;/EM&gt; exist in SYSOPTION, so that should be fine (particularly as it seems to have been fine with v9 as well).&lt;/P&gt;
&lt;P&gt;And the docs to &lt;STRONG&gt;sasql_set_option&lt;/STRONG&gt; just list three possible options to set, and these are not the typical SET OPTION options...&lt;/P&gt;
&lt;P&gt;Just my observations:)&lt;/P&gt;</description>
      <pubDate>Tue, 04 Oct 2011 15:43:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sql-error-using-sqlanywhere-php-api-sasql-query/qaa-p/13849302#M4880145</guid>
      <dc:creator>VolkerBarth</dc:creator>
      <dc:date>2011-10-04T15:43:50Z</dc:date>
    </item>
    <item>
      <title>Re: SQL error using sqlanywhere php API sasql_query()</title>
      <link>https://community.sap.com/t5/technology-q-a/sql-error-using-sqlanywhere-php-api-sasql-query/qaa-p/13849303#M4880146</link>
      <description>&lt;P&gt;Yes, i can try to change and the query works with no errors. But, behinds the scenes a new temporary record is created for my current php user. At least, no errors.&lt;/P&gt;</description>
      <pubDate>Tue, 04 Oct 2011 15:45:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sql-error-using-sqlanywhere-php-api-sasql-query/qaa-p/13849303#M4880146</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-10-04T15:45:20Z</dc:date>
    </item>
    <item>
      <title>Re: SQL error using sqlanywhere php API sasql_query()</title>
      <link>https://community.sap.com/t5/technology-q-a/sql-error-using-sqlanywhere-php-api-sasql-query/qaa-p/13849304#M4880147</link>
      <description>&lt;P&gt;That would imply the setting as PUBLIC does not take effect. Have you used the "SET OPTION PUBLIC.MyOption" syntax (as your .Net sample has not)?&lt;/P&gt;</description>
      <pubDate>Tue, 04 Oct 2011 15:55:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sql-error-using-sqlanywhere-php-api-sasql-query/qaa-p/13849304#M4880147</guid>
      <dc:creator>VolkerBarth</dc:creator>
      <dc:date>2011-10-04T15:55:26Z</dc:date>
    </item>
    <item>
      <title>Re: SQL error using sqlanywhere php API sasql_query()</title>
      <link>https://community.sap.com/t5/technology-q-a/sql-error-using-sqlanywhere-php-api-sasql-query/qaa-p/13849305#M4880148</link>
      <description>&lt;P&gt;Yes, i have review with no success.&lt;/P&gt;
&lt;P&gt;User-defined options DO HAVE &lt;EM&gt;PUBLIC&lt;/EM&gt; settings. Either via known application or PHP API.&lt;/P&gt;
&lt;P&gt;I have created a non-existent option and it returns me "'xxx' is an unknown option" BUT it is created in the database, which i can see by:
SELECT * FROM SYSOPTIONS WHERE "option" like '%xxx%'&lt;/P&gt;
&lt;P&gt;I thought &lt;EM&gt;sasql_set_option&lt;/EM&gt; would solve my problem too, but in documentation says: auto_commit, row_counts or verbose_errors are only available as options.&lt;/P&gt;</description>
      <pubDate>Tue, 04 Oct 2011 16:06:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sql-error-using-sqlanywhere-php-api-sasql-query/qaa-p/13849305#M4880148</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-10-04T16:06:28Z</dc:date>
    </item>
    <item>
      <title>Re: SQL error using sqlanywhere php API sasql_query()</title>
      <link>https://community.sap.com/t5/technology-q-a/sql-error-using-sqlanywhere-php-api-sasql-query/qaa-p/13849306#M4880149</link>
      <description>&lt;P&gt;&lt;STRONG&gt; And the docs to sasql_set_option just list three possible options to set, and these are not the typical SET OPTION options...&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Yes, I meant to edit my answer prior to people noticing I included this note by accident - I noticed when reading the docs while creating the HREF link that 'values' only conspicuously has three options. sasql_set_option should not be relevant to this discussion.&lt;/P&gt;</description>
      <pubDate>Tue, 04 Oct 2011 16:32:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sql-error-using-sqlanywhere-php-api-sasql-query/qaa-p/13849306#M4880149</guid>
      <dc:creator>jeff_albion</dc:creator>
      <dc:date>2011-10-04T16:32:25Z</dc:date>
    </item>
    <item>
      <title>Re: SQL error using sqlanywhere php API sasql_query()</title>
      <link>https://community.sap.com/t5/technology-q-a/sql-error-using-sqlanywhere-php-api-sasql-query/qaa-p/13849307#M4880150</link>
      <description>&lt;P&gt;Well, yes, sometimes we're fast readers:)&lt;/P&gt;</description>
      <pubDate>Wed, 05 Oct 2011 03:18:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sql-error-using-sqlanywhere-php-api-sasql-query/qaa-p/13849307#M4880150</guid>
      <dc:creator>VolkerBarth</dc:creator>
      <dc:date>2011-10-05T03:18:06Z</dc:date>
    </item>
    <item>
      <title>Re: SQL error using sqlanywhere php API sasql_query()</title>
      <link>https://community.sap.com/t5/technology-q-a/sql-error-using-sqlanywhere-php-api-sasql-query/qaa-p/13849308#M4880151</link>
      <description>&lt;P&gt;I said a wrong positive error. .NET is working.
Now i think this is a php API issue.&lt;/P&gt;
&lt;P&gt;I'll try to solve this wraping the SET OPTION inside some procedure.&lt;/P&gt;</description>
      <pubDate>Wed, 05 Oct 2011 10:12:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sql-error-using-sqlanywhere-php-api-sasql-query/qaa-p/13849308#M4880151</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-10-05T10:12:32Z</dc:date>
    </item>
    <item>
      <title>Re: SQL error using sqlanywhere php API sasql_query()</title>
      <link>https://community.sap.com/t5/technology-q-a/sql-error-using-sqlanywhere-php-api-sasql-query/qaa-p/13849298#M4880141</link>
      <description>&lt;P&gt;I could not solve the problem.&lt;/P&gt;
&lt;P&gt;I did a work around wrapping SET OPTION inside a procedure, it works, but it leaded me to another big frustration i could not understand.&lt;/P&gt;
&lt;P&gt;If you're curious, i opened a question here since it is another issue.&lt;/P&gt;
&lt;P&gt;&lt;A href="http://sqlanywhere-forum.sap.com/questions/7856/procedure-weird-set-option-error"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/questions/7856/procedure-weird-set-option-error"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/questions/7856/procedure-weird-set-option-error"&gt;http://sqlanywhere-forum.sap.com/questions/7856/procedure-weird-set-option-error&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 05 Oct 2011 13:33:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sql-error-using-sqlanywhere-php-api-sasql-query/qaa-p/13849298#M4880141</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-10-05T13:33:19Z</dc:date>
    </item>
    <item>
      <title>Re: SQL error using sqlanywhere php API sasql_query()</title>
      <link>https://community.sap.com/t5/technology-q-a/sql-error-using-sqlanywhere-php-api-sasql-query/qaa-p/13849309#M4880152</link>
      <description>&lt;P&gt;Well, obviously &lt;EM&gt;that&lt;/EM&gt; weird problem seems solved:)&lt;/P&gt;</description>
      <pubDate>Wed, 05 Oct 2011 17:44:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sql-error-using-sqlanywhere-php-api-sasql-query/qaa-p/13849309#M4880152</guid>
      <dc:creator>VolkerBarth</dc:creator>
      <dc:date>2011-10-05T17:44:22Z</dc:date>
    </item>
  </channel>
</rss>

