<?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 on executing a script in Sybase database in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/syntax-error-on-executing-a-script-in-sybase-database/qaa-p/13841506#M4872349</link>
    <description>&lt;P&gt;Where or from whom did you get the script?  I would go back to where-ever you got the script and ask the owner what type of database should be used.&lt;/P&gt;
&lt;P&gt;If the database should be ASE then you should ask the ASE forum (see FAQ for details on newsgroups ... but do it quick because I believe all of the newsgroups are getting set to read-only on Dec. 1st). Note: I am not an ASE expert.  You should likely use some ASE tool (isql) to run the script against an ASE database.&lt;/P&gt;</description>
    <pubDate>Mon, 26 Nov 2012 13:51:07 GMT</pubDate>
    <dc:creator>MarkCulp</dc:creator>
    <dc:date>2012-11-26T13:51:07Z</dc:date>
    <item>
      <title>Syntax error on executing a script in Sybase database</title>
      <link>https://community.sap.com/t5/technology-q-a/syntax-error-on-executing-a-script-in-sybase-database/qaq-p/13841501</link>
      <description>&lt;P&gt;I created a Sybase database emp_details using SQL Anywhere and Sybase Central. I had given emp/emp as dba username/password while creating.&lt;/P&gt;
&lt;P&gt;The db got created and the files were generated in the given folder.&lt;/P&gt;
&lt;P&gt;When I tried running the below script using Ineractive SQL:&lt;/P&gt;
&lt;DIV class="codehilite"&gt;&lt;PRE&gt;&lt;SPAN class="k"&gt;use&lt;/SPAN&gt; &lt;SPAN class="n"&gt;master&lt;/SPAN&gt;
&lt;SPAN class="n"&gt;go&lt;/SPAN&gt;

&lt;SPAN class="k"&gt;if&lt;/SPAN&gt; &lt;SPAN class="nb"&gt;exists&lt;/SPAN&gt; &lt;SPAN class="p"&gt;(&lt;/SPAN&gt;&lt;SPAN class="nb"&gt;select&lt;/SPAN&gt; &lt;SPAN class="mi"&gt;1&lt;/SPAN&gt; &lt;SPAN class="n"&gt;from&lt;/SPAN&gt; &lt;SPAN class="n"&gt;master&lt;/SPAN&gt;&lt;SPAN class="o"&gt;..&lt;/SPAN&gt;&lt;SPAN class="n"&gt;sysdatabases&lt;/SPAN&gt; &lt;SPAN class="n"&gt;where&lt;/SPAN&gt; &lt;SPAN class="n"&gt;name&lt;/SPAN&gt;&lt;SPAN class="o"&gt;=&lt;/SPAN&gt;&lt;SPAN class="s"&gt;'emp_details'&lt;/SPAN&gt;&lt;SPAN class="p"&gt;)&lt;/SPAN&gt;
    &lt;SPAN class="n"&gt;checkpoint&lt;/SPAN&gt; &lt;SPAN class="n"&gt;emp_details&lt;/SPAN&gt;
&lt;SPAN class="n"&gt;go&lt;/SPAN&gt;
&lt;/PRE&gt;&lt;/DIV&gt;


&lt;P&gt;It threw the following exception&lt;/P&gt;
&lt;DIV class="codehilite"&gt;&lt;PRE&gt;&lt;SPAN class="n"&gt;Could&lt;/SPAN&gt; &lt;SPAN class="ow"&gt;not&lt;/SPAN&gt; &lt;SPAN class="n"&gt;execute&lt;/SPAN&gt; &lt;SPAN class="n"&gt;statement&lt;/SPAN&gt;&lt;SPAN class="o"&gt;.&lt;/SPAN&gt;
&lt;SPAN class="n"&gt;Syntax&lt;/SPAN&gt; &lt;SPAN class="n"&gt;error&lt;/SPAN&gt; &lt;SPAN class="n"&gt;near&lt;/SPAN&gt; &lt;SPAN class="s"&gt;'checkpoint'&lt;/SPAN&gt; &lt;SPAN class="n"&gt;on&lt;/SPAN&gt; &lt;SPAN class="n"&gt;line&lt;/SPAN&gt; &lt;SPAN class="mi"&gt;2&lt;/SPAN&gt;
&lt;SPAN class="n"&gt;SQLCODE&lt;/SPAN&gt;&lt;SPAN class="o"&gt;=-&lt;/SPAN&gt;&lt;SPAN class="mi"&gt;131&lt;/SPAN&gt;&lt;SPAN class="p"&gt;,&lt;/SPAN&gt; &lt;SPAN class="n"&gt;ODBC&lt;/SPAN&gt; &lt;SPAN class="mi"&gt;3&lt;/SPAN&gt; &lt;SPAN class="n"&gt;State&lt;/SPAN&gt;&lt;SPAN class="o"&gt;=&lt;/SPAN&gt;&lt;SPAN class="s"&gt;"42000"&lt;/SPAN&gt;
&lt;SPAN class="n"&gt;Line&lt;/SPAN&gt; &lt;SPAN class="mi"&gt;4&lt;/SPAN&gt;&lt;SPAN class="p"&gt;,&lt;/SPAN&gt; &lt;SPAN class="n"&gt;column&lt;/SPAN&gt; &lt;SPAN class="mi"&gt;1&lt;/SPAN&gt;
&lt;/PRE&gt;&lt;/DIV&gt;


&lt;P&gt;Haven't been able to figure out what exactly the syntax issue is and have been stuck up with this for a while.&lt;/P&gt;
&lt;P&gt;Any ideas?&lt;/P&gt;
&lt;HR /&gt;
&lt;P&gt;&lt;STRONG&gt;Edit: Issue got resolved by installing Sybase ASE. Was able to run the script as it is.&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Nov 2012 12:55:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/syntax-error-on-executing-a-script-in-sybase-database/qaq-p/13841501</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-11-26T12:55:31Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax error on executing a script in Sybase database</title>
      <link>https://community.sap.com/t5/technology-q-a/syntax-error-on-executing-a-script-in-sybase-database/qaa-p/13841502#M4872345</link>
      <description>&lt;P&gt;I think you are mixing dialect ... try doing this:&lt;/P&gt;
&lt;DIV class="codehilite"&gt;&lt;PRE&gt;&lt;SPAN class="k"&gt;if&lt;/SPAN&gt; &lt;SPAN class="nb"&gt;exists&lt;/SPAN&gt; &lt;SPAN class="p"&gt;(&lt;/SPAN&gt;&lt;SPAN class="nb"&gt;select&lt;/SPAN&gt; &lt;SPAN class="mi"&gt;1&lt;/SPAN&gt; &lt;SPAN class="n"&gt;from&lt;/SPAN&gt; &lt;SPAN class="n"&gt;master&lt;/SPAN&gt;&lt;SPAN class="o"&gt;..&lt;/SPAN&gt;&lt;SPAN class="n"&gt;sysdatabases&lt;/SPAN&gt; &lt;SPAN class="n"&gt;where&lt;/SPAN&gt; &lt;SPAN class="n"&gt;name&lt;/SPAN&gt;&lt;SPAN class="o"&gt;=&lt;/SPAN&gt;&lt;SPAN class="s"&gt;'emp_details'&lt;/SPAN&gt;&lt;SPAN class="p"&gt;)&lt;/SPAN&gt; &lt;SPAN class="k"&gt;then&lt;/SPAN&gt;
    &lt;SPAN class="n"&gt;checkpoint&lt;/SPAN&gt;&lt;SPAN class="p"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="n"&gt;end&lt;/SPAN&gt; &lt;SPAN class="k"&gt;if&lt;/SPAN&gt;&lt;SPAN class="p"&gt;;&lt;/SPAN&gt;
&lt;/PRE&gt;&lt;/DIV&gt;


&lt;HR /&gt;
&lt;P&gt;Hmmm, but looking at what you are trying to do it looks like you may NOT be connected to a SQL Anywhere database because 'sysdatabases' table does not exist in a typical SQL Anywhere database.  Are you connecting to ASE?&lt;/P&gt;</description>
      <pubDate>Mon, 26 Nov 2012 12:57:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/syntax-error-on-executing-a-script-in-sybase-database/qaa-p/13841502#M4872345</guid>
      <dc:creator>MarkCulp</dc:creator>
      <dc:date>2012-11-26T12:57:37Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax error on executing a script in Sybase database</title>
      <link>https://community.sap.com/t5/technology-q-a/syntax-error-on-executing-a-script-in-sybase-database/qaa-p/13841505#M4872348</link>
      <description>&lt;P&gt;&lt;A href="https://sqlanywhere-forum.sap.com/users/239/mark/"&gt;@Mark&lt;/A&gt; Culp. I am trying to connect to an SQL Anywhere database, which now i think is wrong. All we have is the script and info that it should be a Sybase DB. So should we create a Sybase ASE DB? do they have the sysdatabases. If yes, can it be done using Sybase Central?&lt;/P&gt;</description>
      <pubDate>Mon, 26 Nov 2012 13:11:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/syntax-error-on-executing-a-script-in-sybase-database/qaa-p/13841505#M4872348</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-11-26T13:11:35Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax error on executing a script in Sybase database</title>
      <link>https://community.sap.com/t5/technology-q-a/syntax-error-on-executing-a-script-in-sybase-database/qaa-p/13841506#M4872349</link>
      <description>&lt;P&gt;Where or from whom did you get the script?  I would go back to where-ever you got the script and ask the owner what type of database should be used.&lt;/P&gt;
&lt;P&gt;If the database should be ASE then you should ask the ASE forum (see FAQ for details on newsgroups ... but do it quick because I believe all of the newsgroups are getting set to read-only on Dec. 1st). Note: I am not an ASE expert.  You should likely use some ASE tool (isql) to run the script against an ASE database.&lt;/P&gt;</description>
      <pubDate>Mon, 26 Nov 2012 13:51:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/syntax-error-on-executing-a-script-in-sybase-database/qaa-p/13841506#M4872349</guid>
      <dc:creator>MarkCulp</dc:creator>
      <dc:date>2012-11-26T13:51:07Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax error on executing a script in Sybase database</title>
      <link>https://community.sap.com/t5/technology-q-a/syntax-error-on-executing-a-script-in-sybase-database/qaa-p/13841503#M4872346</link>
      <description>&lt;P&gt;FWIW, ASE (as MS SQL Server) uses an architecure where each database server instance has one particular master database and as many "attached" databases as one likes, and one can list any database via the master's sysdatabases table. - That's what the script seems to try to, and so &lt;STRONG&gt;I would conclude you're using ASE&lt;/STRONG&gt;.&lt;/P&gt;
&lt;P&gt;In contrast, a SQL Anywhere database server can run several databases, too, but does not use a particular master database, so each database is managed on its own, and there is no general sysdatabases table. Of course, there are other means to list all databases running on a SQL Anywhere server.&lt;/P&gt;</description>
      <pubDate>Tue, 27 Nov 2012 03:27:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/syntax-error-on-executing-a-script-in-sybase-database/qaa-p/13841503#M4872346</guid>
      <dc:creator>VolkerBarth</dc:creator>
      <dc:date>2012-11-27T03:27:45Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax error on executing a script in Sybase database</title>
      <link>https://community.sap.com/t5/technology-q-a/syntax-error-on-executing-a-script-in-sybase-database/qaa-p/13841504#M4872347</link>
      <description>&lt;P&gt;looks like checkpoint is not allowed inside if..go block, try directly running it.&lt;/P&gt;</description>
      <pubDate>Tue, 27 Nov 2012 13:47:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/syntax-error-on-executing-a-script-in-sybase-database/qaa-p/13841504#M4872347</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-11-27T13:47:21Z</dc:date>
    </item>
  </channel>
</rss>

