<?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: Error SQLCODE -267 from stored procedure in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/error-sqlcode-267-from-stored-procedure/qaa-p/13850303#M4881146</link>
    <description>&lt;P&gt;We are using jdbc3 (com.sybase.jdbc3.jdbc.SybDataSource ) driver&lt;/P&gt;</description>
    <pubDate>Mon, 07 Nov 2011 11:53:24 GMT</pubDate>
    <dc:creator>former_SQLA_member1694890</dc:creator>
    <dc:date>2011-11-07T11:53:24Z</dc:date>
    <item>
      <title>Error SQLCODE -267 from stored procedure</title>
      <link>https://community.sap.com/t5/technology-q-a/error-sqlcode-267-from-stored-procedure/qaq-p/13850296</link>
      <description>&lt;P&gt;We are used SA 12.0.1(EBF 3324(Win)/3311(Linux)). Stored procedure(SP) in T-SQL prepared data in temp table and return result set as select from this temp table. When preparing data used select from another SP written in WATCOM-SQL. Something like -
 INSERT INTO #TEMP_MOBILE_SP_TOP SELECT A,B,C FROM SP_WATCOM_PR(X,Y),CONV_TABLE
Calling this SP from interactive SQL(dbisql) everything is working properly and we get required result.
But when this SP is called from Java server code(based on JBOSS) in database log appears error SQLCODE = -267 COMMIT/ROLLBACK not allowed within atomic operation (error print from SP), in Java server log appears error SQL Anywhere Error -260: Variable '@result' not found. 
Any idea what could be reason for this difference from DBISQL it is OK, from Java code using JDBC not!?
Thanks in advance, Hanan Brener &lt;/P&gt;</description>
      <pubDate>Mon, 07 Nov 2011 10:56:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/error-sqlcode-267-from-stored-procedure/qaq-p/13850296</guid>
      <dc:creator>former_SQLA_member1694890</dc:creator>
      <dc:date>2011-11-07T10:56:14Z</dc:date>
    </item>
    <item>
      <title>Re: Error SQLCODE -267 from stored procedure</title>
      <link>https://community.sap.com/t5/technology-q-a/error-sqlcode-267-from-stored-procedure/qaa-p/13850299#M4881142</link>
      <description>&lt;P&gt;Where in your code is the variable "@result" being referenced?  Find that code and you have likely found your problem.&lt;/P&gt;</description>
      <pubDate>Mon, 07 Nov 2011 11:00:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/error-sqlcode-267-from-stored-procedure/qaa-p/13850299#M4881142</guid>
      <dc:creator>MarkCulp</dc:creator>
      <dc:date>2011-11-07T11:00:41Z</dc:date>
    </item>
    <item>
      <title>Re: Error SQLCODE -267 from stored procedure</title>
      <link>https://community.sap.com/t5/technology-q-a/error-sqlcode-267-from-stored-procedure/qaa-p/13850300#M4881143</link>
      <description>&lt;P&gt;Problem is with error -267; The same SP when used without using seelect with WATCOM-SQL is working properly. Variable @result is declared as int and it not make problem.&lt;/P&gt;</description>
      <pubDate>Mon, 07 Nov 2011 11:06:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/error-sqlcode-267-from-stored-procedure/qaa-p/13850300#M4881143</guid>
      <dc:creator>former_SQLA_member1694890</dc:creator>
      <dc:date>2011-11-07T11:06:51Z</dc:date>
    </item>
    <item>
      <title>Re: Error SQLCODE -267 from stored procedure</title>
      <link>https://community.sap.com/t5/technology-q-a/error-sqlcode-267-from-stored-procedure/qaa-p/13850301#M4881144</link>
      <description>&lt;P&gt;Is there a commit/rollback in the Watcom procedure?&lt;/P&gt;</description>
      <pubDate>Mon, 07 Nov 2011 11:22:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/error-sqlcode-267-from-stored-procedure/qaa-p/13850301#M4881144</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-11-07T11:22:53Z</dc:date>
    </item>
    <item>
      <title>Re: Error SQLCODE -267 from stored procedure</title>
      <link>https://community.sap.com/t5/technology-q-a/error-sqlcode-267-from-stored-procedure/qaa-p/13850302#M4881145</link>
      <description>&lt;P&gt;No, any commit/rollback in Watcom SP. May be 'Autocommit' make problem !?&lt;/P&gt;</description>
      <pubDate>Mon, 07 Nov 2011 11:26:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/error-sqlcode-267-from-stored-procedure/qaa-p/13850302#M4881145</guid>
      <dc:creator>former_SQLA_member1694890</dc:creator>
      <dc:date>2011-11-07T11:26:01Z</dc:date>
    </item>
    <item>
      <title>Re: Error SQLCODE -267 from stored procedure</title>
      <link>https://community.sap.com/t5/technology-q-a/error-sqlcode-267-from-stored-procedure/qaa-p/13850297#M4881140</link>
      <description>&lt;P&gt;Which JDBC driver are you using from your JBOSS Java application?&lt;/P&gt;</description>
      <pubDate>Mon, 07 Nov 2011 11:48:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/error-sqlcode-267-from-stored-procedure/qaa-p/13850297#M4881140</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-11-07T11:48:03Z</dc:date>
    </item>
    <item>
      <title>Re: Error SQLCODE -267 from stored procedure</title>
      <link>https://community.sap.com/t5/technology-q-a/error-sqlcode-267-from-stored-procedure/qaa-p/13850303#M4881146</link>
      <description>&lt;P&gt;We are using jdbc3 (com.sybase.jdbc3.jdbc.SybDataSource ) driver&lt;/P&gt;</description>
      <pubDate>Mon, 07 Nov 2011 11:53:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/error-sqlcode-267-from-stored-procedure/qaa-p/13850303#M4881146</guid>
      <dc:creator>former_SQLA_member1694890</dc:creator>
      <dc:date>2011-11-07T11:53:24Z</dc:date>
    </item>
    <item>
      <title>Re: Error SQLCODE -267 from stored procedure</title>
      <link>https://community.sap.com/t5/technology-q-a/error-sqlcode-267-from-stored-procedure/qaa-p/13850304#M4881147</link>
      <description>&lt;P&gt;No, the problem is likely caused by the variable not found error. I will take a look.&lt;/P&gt;</description>
      <pubDate>Mon, 07 Nov 2011 11:58:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/error-sqlcode-267-from-stored-procedure/qaa-p/13850304#M4881147</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-11-07T11:58:54Z</dc:date>
    </item>
    <item>
      <title>Re: Error SQLCODE -267 from stored procedure</title>
      <link>https://community.sap.com/t5/technology-q-a/error-sqlcode-267-from-stored-procedure/qaa-p/13850298#M4881141</link>
      <description>&lt;P&gt;By default, TDS (jConnect) connections have the "&lt;A href="http://dcx.sybase.com/index.html#1201/en/dbadmin/chained-option.html"&gt;chained&lt;/A&gt;" option turned off, so a DML operation in the procedure will perform an autocommit. (This is turned on via the '&lt;A href="http://dcx.sybase.com/index.html#1201/en/dbreference/sp-tsql-environment-sysproc.html"&gt;sp_tsql_environment&lt;/A&gt;' stored procedure).&lt;/P&gt;
&lt;P&gt;The fix is to call: &lt;A href="http://download.oracle.com/javase/6/docs/api/java/sql/Connection.html#setAutoCommit%28boolean%29"&gt;conn.setAutoCommit(false)&lt;/A&gt; prior to executing the CallableStatement and then turn it back on later. Better yet, it would be best to call conn.setAutoCommit(false) immediately after connecting and explicitly issuing commits as needed.&lt;/P&gt;
&lt;P&gt;See: &lt;A href="http://search.sybase.com/kbx/solvedcases?id_number=11435344"&gt;&lt;/A&gt;&lt;A href="http://search.sybase.com/kbx/solvedcases?id_number=11435344"&gt;&lt;/A&gt;&lt;A href="http://search.sybase.com/kbx/solvedcases?id_number=11435344"&gt;http://search.sybase.com/kbx/solvedcases?id_number=11435344&lt;/A&gt; for more information about this situation.&lt;/P&gt;
&lt;P&gt;(Aside: Interactive SQL uses the &lt;A href="http://dcx.sybase.com/index.html#1201/en/dbprogramming/jdbc-odbc-bridge-jdbc.html"&gt;SQL Anywhere JDBC&lt;/A&gt; ("Type 2") driver, which is a Java/native hybrid, rather than the &lt;A href="http://dcx.sybase.com/index.html#1201/en/dbprogramming/choosing-jdbc-jdbc.html"&gt;jConnect&lt;/A&gt; ("Type 4") driver which is just a pure Java driver - these are not the same JDBC drivers).&lt;/P&gt;</description>
      <pubDate>Mon, 07 Nov 2011 13:03:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/error-sqlcode-267-from-stored-procedure/qaa-p/13850298#M4881141</guid>
      <dc:creator>jeff_albion</dc:creator>
      <dc:date>2011-11-07T13:03:17Z</dc:date>
    </item>
    <item>
      <title>Re: Error SQLCODE -267 from stored procedure</title>
      <link>https://community.sap.com/t5/technology-q-a/error-sqlcode-267-from-stored-procedure/qaa-p/13850305#M4881148</link>
      <description>&lt;P&gt;Thanks for answer, can we do this (AUTOCOMMIT false) inside stored procedure !?&lt;/P&gt;</description>
      <pubDate>Mon, 07 Nov 2011 14:17:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/error-sqlcode-267-from-stored-procedure/qaa-p/13850305#M4881148</guid>
      <dc:creator>former_SQLA_member1694890</dc:creator>
      <dc:date>2011-11-07T14:17:30Z</dc:date>
    </item>
  </channel>
</rss>

