<?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: Validate sql statements in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/validate-sql-statements/qaa-p/13849149#M4879992</link>
    <description>&lt;P&gt;Also consider SQLDIALECT(), WATCOMSQL(), TRANSACTSQL(), REWRITE() and SQLFLAGGER().&lt;/P&gt;</description>
    <pubDate>Mon, 23 Feb 2015 06:22:41 GMT</pubDate>
    <dc:creator>Breck_Carter</dc:creator>
    <dc:date>2015-02-23T06:22:41Z</dc:date>
    <item>
      <title>Validate sql statements</title>
      <link>https://community.sap.com/t5/technology-q-a/validate-sql-statements/qaq-p/13849148</link>
      <description>&lt;P&gt;I was thinking that I could use:&lt;/P&gt;
&lt;P&gt;SELECT PLAN('statement goes here');&lt;/P&gt;
&lt;P&gt;If the result is some text, then I know the syntax of the sql statement is valid. &lt;/P&gt;
&lt;P&gt;Is there a better way of doing such validations?&lt;/P&gt;
&lt;P&gt;I'm interested solely in validating the syntax correctness of an sql script.&lt;/P&gt;</description>
      <pubDate>Mon, 23 Feb 2015 05:24:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/validate-sql-statements/qaq-p/13849148</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2015-02-23T05:24:26Z</dc:date>
    </item>
    <item>
      <title>Re: Validate sql statements</title>
      <link>https://community.sap.com/t5/technology-q-a/validate-sql-statements/qaa-p/13849149#M4879992</link>
      <description>&lt;P&gt;Also consider SQLDIALECT(), WATCOMSQL(), TRANSACTSQL(), REWRITE() and SQLFLAGGER().&lt;/P&gt;</description>
      <pubDate>Mon, 23 Feb 2015 06:22:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/validate-sql-statements/qaa-p/13849149#M4879992</guid>
      <dc:creator>Breck_Carter</dc:creator>
      <dc:date>2015-02-23T06:22:41Z</dc:date>
    </item>
    <item>
      <title>Re: Validate sql statements</title>
      <link>https://community.sap.com/t5/technology-q-a/validate-sql-statements/qaa-p/13849150#M4879993</link>
      <description>&lt;P&gt;"DBISQL -x" might also help...&lt;/P&gt;</description>
      <pubDate>Mon, 23 Feb 2015 06:45:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/validate-sql-statements/qaa-p/13849150#M4879993</guid>
      <dc:creator>VolkerBarth</dc:creator>
      <dc:date>2015-02-23T06:45:08Z</dc:date>
    </item>
    <item>
      <title>Re: Validate sql statements</title>
      <link>https://community.sap.com/t5/technology-q-a/validate-sql-statements/qaa-p/13849151#M4879994</link>
      <description>&lt;P&gt;It might be added that "select plan()" will only work for SQL statements that generate a plan, i.e. for single queries and DML statements, not for procedure calls or DDL statements. However, it seems to check whether the schema is valid for the statement, so it will notify about misspelled identifiers or non-existing tables/columns. That makes it only partially useful for "syntax-only" validation.&lt;/P&gt;
&lt;HR /&gt;
&lt;P&gt;REWRITE() and DBISQL -x in contrast can parse all statements, however, they will only check for syntax errors (as you have asked for). E.g. the following will raise a syntax error:&lt;/P&gt;
&lt;PRE class="codehilite"&gt;&lt;CODE&gt;GRANT SELECTX ON products for MyUser;


&lt;P&gt;whereas they will not check whether "products" or "MyUser" actually do exist.&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 24 Feb 2015 03:49:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/validate-sql-statements/qaa-p/13849151#M4879994</guid>
      <dc:creator>VolkerBarth</dc:creator>
      <dc:date>2015-02-24T03:49:51Z</dc:date>
    </item>
  </channel>
</rss>

