<?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 ANYWHERE 17: Errors CREATE-ing multiple procedures/functions t-sql in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/sql-anywhere-17-errors-create-ing-multiple-procedures-functions-t-sql/qaa-p/13827290#M4858133</link>
    <description>&lt;P&gt;Thanks for the clarification, and yes, I had incidentally run my small test with v16, not with v17.&lt;/P&gt;</description>
    <pubDate>Sat, 01 May 2021 07:07:09 GMT</pubDate>
    <dc:creator>VolkerBarth</dc:creator>
    <dc:date>2021-05-01T07:07:09Z</dc:date>
    <item>
      <title>SQL ANYWHERE 17: Errors CREATE-ing multiple procedures/functions t-sql</title>
      <link>https://community.sap.com/t5/technology-q-a/sql-anywhere-17-errors-create-ing-multiple-procedures-functions-t-sql/qaq-p/13827287</link>
      <description>&lt;P&gt;If I run the following statement:&lt;/P&gt;
&lt;DIV&gt;&lt;PRE&gt;&lt;SPAN&gt;&lt;/SPAN&gt;//create a watcom function
CREATE OR REPLACE FUNCTION "DBA"."TEST1" (&lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;@val&lt;/A&gt; INT)
RETURNS INTEGER
BEGIN

    IF (&lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;@val&lt;/A&gt; = 1) THEN
        SET &lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;@val&lt;/A&gt; = 2;
    ENDIF;

    RETURN &lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;@Val&lt;/A&gt;;
END;
//create a t-sql function
CREATE OR REPLACE FUNCTION "DBA"."TEST2" (&lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;@val&lt;/A&gt; INT)
RETURNS INTEGER
AS
BEGIN

    IF &lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;@val&lt;/A&gt; = 1 BEGIN
        SET &lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;@val&lt;/A&gt; = 2;
    END
    RETURN &lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;@Val&lt;/A&gt;;
END;
&lt;/PRE&gt;&lt;/DIV&gt;


&lt;P&gt;It runs fine, no errors.&lt;/P&gt;
&lt;P&gt;But if I run this:&lt;/P&gt;
&lt;DIV&gt;&lt;PRE&gt;&lt;SPAN&gt;&lt;/SPAN&gt;//create a t-sql function
CREATE OR REPLACE FUNCTION "DBA"."TEST1" (&lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;@val&lt;/A&gt; INT)
RETURNS INTEGER
AS
BEGIN

    IF (&lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;@val&lt;/A&gt; = 1) BEGIN
        SET &lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;@val&lt;/A&gt; = 2;
    END

    RETURN &lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;@Val&lt;/A&gt;;
END;
//create a t-sql function
CREATE OR REPLACE FUNCTION "DBA"."TEST2" (&lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;@val&lt;/A&gt; INT)
RETURNS INTEGER
AS
BEGIN

    IF &lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;@val&lt;/A&gt; = 1 BEGIN
        SET &lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;@val&lt;/A&gt; = 2;
    END
    RETURN &lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas" target="_blank"&gt;@Val&lt;/A&gt;;
END;
&lt;/PRE&gt;&lt;/DIV&gt;


&lt;P&gt;It throws:&lt;/P&gt;
&lt;DIV&gt;&lt;PRE&gt;&lt;SPAN&gt;&lt;/SPAN&gt;Could not execute statement.
Syntax error near 'FUNCTION' on line 14 (Transact-SQL)
SQLCODE=-131, ODBC 3 State="42000"
Line 15
&lt;/PRE&gt;&lt;/DIV&gt;


&lt;P&gt;Line 14 is where the second function declaration starts, so it's like it's reading off the end of the first function because of the BEGIN/END statement in the IF clause.&lt;/P&gt;
&lt;P&gt;Am I writing bad code and/or is there something I'm missing? 
I write most of my procedure/functions in t-sql and use IF/ELSE quite a bit. If run the CREATE FUNCTION statements individually they don't throw errors. &lt;/P&gt;
&lt;P&gt;Any help would be appreciated.&lt;/P&gt;
&lt;P&gt;SQL Anywhere 17 17.0.10.5963&lt;/P&gt;</description>
      <pubDate>Fri, 30 Apr 2021 08:20:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sql-anywhere-17-errors-create-ing-multiple-procedures-functions-t-sql/qaq-p/13827287</guid>
      <dc:creator>former_SQLA_member1694902</dc:creator>
      <dc:date>2021-04-30T08:20:00Z</dc:date>
    </item>
    <item>
      <title>Re: SQL ANYWHERE 17: Errors CREATE-ing multiple procedures/functions t-sql</title>
      <link>https://community.sap.com/t5/technology-q-a/sql-anywhere-17-errors-create-ing-multiple-procedures-functions-t-sql/qaa-p/13827288#M4858131</link>
      <description>&lt;P&gt;Transact-SQL (at least the ASE-compatible variant used within SQL Anywhere) does not use the semicolon as statement delimiter, and a batch of SQL statements must either by completely written in Watcom SQL or TSQL, see &lt;A href="http://dcx.sap.com/index.html#sqla170/en/html/819464c66ce21014b5e0d309298c8270.html"&gt;here&lt;/A&gt;:&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;SQL statements not separated by semicolons are part of a Transact-SQL procedure or batch.&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;So just omit the semicolons altogether and possilby add a "go" between different DDL statements.&lt;/P&gt;
&lt;HR /&gt;
&lt;P&gt;Besides that, the T-SQL function does seem to use a mix of both dialects, at least the SQLDIALECT function does return an error when called with the T-SQL code. FWIW, the TRANSACTSQL function called with the first function does return:&lt;/P&gt;
&lt;PRE&gt;create or replace function DBA.TEST1( &lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas"&gt;@val&lt;/A&gt; integer ) 
returns integer as
begin
  if(&lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas"&gt;@val&lt;/A&gt; = 1)
    set &lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas"&gt;&lt;/A&gt;&lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas"&gt;@val&lt;/A&gt; = 2
  return &lt;A href="http://sqlanywhere-forum.sap.com/users/434/valdas"&gt;@Val&lt;/A&gt;
end&lt;/PRE&gt;</description>
      <pubDate>Fri, 30 Apr 2021 08:48:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sql-anywhere-17-errors-create-ing-multiple-procedures-functions-t-sql/qaa-p/13827288#M4858131</guid>
      <dc:creator>VolkerBarth</dc:creator>
      <dc:date>2021-04-30T08:48:42Z</dc:date>
    </item>
    <item>
      <title>Re: SQL ANYWHERE 17: Errors CREATE-ing multiple procedures/functions t-sql</title>
      <link>https://community.sap.com/t5/technology-q-a/sql-anywhere-17-errors-create-ing-multiple-procedures-functions-t-sql/qaa-p/13827289#M4858132</link>
      <description>&lt;P&gt;This would been permitted in versions prior to SQLA17 albeit it is mixing of the Watcom and TSQL dialects. SQLA 17 added support for semicolon delimiters in TSQL procedures and batches but in doing so a more strict adherence to TSQL syntax was needed -- meaning mixed dialect statements such as that reported here now fail.  In TSQL, you cannot create two procedures (or functions) in the same batch. A semicolon in TSQL is a statement separator not a batch separator. The correct approach is to either use GO which is a batch separator or execute the CREATE FUNCTIONs separately.&lt;/P&gt;</description>
      <pubDate>Fri, 30 Apr 2021 20:39:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sql-anywhere-17-errors-create-ing-multiple-procedures-functions-t-sql/qaa-p/13827289#M4858132</guid>
      <dc:creator>chris_keating</dc:creator>
      <dc:date>2021-04-30T20:39:39Z</dc:date>
    </item>
    <item>
      <title>Re: SQL ANYWHERE 17: Errors CREATE-ing multiple procedures/functions t-sql</title>
      <link>https://community.sap.com/t5/technology-q-a/sql-anywhere-17-errors-create-ing-multiple-procedures-functions-t-sql/qaa-p/13827290#M4858133</link>
      <description>&lt;P&gt;Thanks for the clarification, and yes, I had incidentally run my small test with v16, not with v17.&lt;/P&gt;</description>
      <pubDate>Sat, 01 May 2021 07:07:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sql-anywhere-17-errors-create-ing-multiple-procedures-functions-t-sql/qaa-p/13827290#M4858133</guid>
      <dc:creator>VolkerBarth</dc:creator>
      <dc:date>2021-05-01T07:07:09Z</dc:date>
    </item>
  </channel>
</rss>

