<?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: Syntax Error in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/syntax-error/qaa-p/13834603#M4865446</link>
    <description>&lt;P&gt;Just omit the last comma before the "END", i.e. close the SQL batch with&lt;/P&gt;
&lt;PRE&gt;    ...
        ('123india.com') ,
        ('123qwe.co.uk')

    END
&lt;/PRE&gt;

&lt;HR /&gt;
&lt;P&gt;Aside: Unless you need T-SQL compatibility, I'd recommend to use SQL Anywhere with the original &lt;A href="http://dcx.sap.com/index.html#sa160/en/dbusage/ug-watcom-sql.html"&gt;Watcom-SQL dialect&lt;/A&gt; instead of T-SQL. IMHO it makes nested IF statements easier to read (and check).&lt;/P&gt;</description>
    <pubDate>Fri, 27 Jan 2017 02:03:50 GMT</pubDate>
    <dc:creator>VolkerBarth</dc:creator>
    <dc:date>2017-01-27T02:03:50Z</dc:date>
    <item>
      <title>Syntax Error</title>
      <link>https://community.sap.com/t5/technology-q-a/syntax-error/qaq-p/13834602</link>
      <description>&lt;P&gt;Hey out there. Was wondering if someone can take a look at this and see where I messed up at?&lt;/P&gt;
&lt;P&gt;Thank you&lt;/P&gt;
&lt;P&gt;Could not execute statement.
syntax error near ',' on line 14
SQLCODE=-131, ODBC 3 STATE="42000"
Line 26, column 1&lt;/P&gt;
&lt;PRE&gt;
/* FileVersion=3.14.101 */
-------------------------------------------------------------------------------
--  DT8281 - Trent 2016.07.27
--  1. Create table PUBLIC_EMAIL_DOMAIN
--  2. Insert records into table PUBLIC_EMAIL_DOMAIN
-------------------------------------------------------------------------------



--  1. Create table PUBLIC_EMAIL_DOMAIN
IF NOT EXISTS
    (SELECT 1
    FROM SYSTABLE
    WHERE table_name = 'PUBLIC_EMAIL_DOMAIN'
    )
BEGIN
    CREATE TABLE "DBA"."PUBLIC_EMAIL_DOMAIN"(
    "email_domain_name" CHAR(50) NOT NULL
    ,PRIMARY KEY ("email_domain_name" ASC) 
    )
END

GO

--  2. Insert records into table PUBLIC_EMAIL_DOMAIN
IF EXISTS
    (SELECT 1
    FROM SYSTABLE
    WHERE table_name = 'PUBLIC_EMAIL_DOMAIN'
    )

    IF (Select count(*) FROM PUBLIC_EMAIL_DOMAIN) = 0

    BEGIN
        INSERT INTO "DBA"."PUBLIC_EMAIL_DOMAIN"
        (email_domain_name)
        VALUES
        ('007addict.com') ,
        ('020.co.uk') ,
        ('123.com') ,
        ('123box.net') ,
        ('123india.com') ,
        ('123qwe.co.uk') ,

    END
&lt;/PRE&gt;</description>
      <pubDate>Thu, 26 Jan 2017 23:21:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/syntax-error/qaq-p/13834602</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2017-01-26T23:21:00Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax Error</title>
      <link>https://community.sap.com/t5/technology-q-a/syntax-error/qaa-p/13834603#M4865446</link>
      <description>&lt;P&gt;Just omit the last comma before the "END", i.e. close the SQL batch with&lt;/P&gt;
&lt;PRE&gt;    ...
        ('123india.com') ,
        ('123qwe.co.uk')

    END
&lt;/PRE&gt;

&lt;HR /&gt;
&lt;P&gt;Aside: Unless you need T-SQL compatibility, I'd recommend to use SQL Anywhere with the original &lt;A href="http://dcx.sap.com/index.html#sa160/en/dbusage/ug-watcom-sql.html"&gt;Watcom-SQL dialect&lt;/A&gt; instead of T-SQL. IMHO it makes nested IF statements easier to read (and check).&lt;/P&gt;</description>
      <pubDate>Fri, 27 Jan 2017 02:03:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/syntax-error/qaa-p/13834603#M4865446</guid>
      <dc:creator>VolkerBarth</dc:creator>
      <dc:date>2017-01-27T02:03:50Z</dc:date>
    </item>
  </channel>
</rss>

