<?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: alter table command not working on a particular table in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/alter-table-command-not-working-on-a-particular-table/qaa-p/13813299#M4844142</link>
    <description>&lt;P&gt;Actually the thing is my one application connects to database server but at the same time i am trying to run alter table command from my C code using unixodbc by creating new connection to the database. But i am not able to do so as it goes in infinite loop and my code doesn't go beyond alter table command that means it is having the same effect as if i try to alter table from dbisql when my application is connected to the database.&lt;/P&gt;
&lt;P&gt;But i am able to use update or select command from my C ODBC code by creating the a new connection but alter is not working.&lt;/P&gt;
&lt;P&gt;Is there some command i should run before running alter as i cannot close the other database connection.&lt;/P&gt;</description>
    <pubDate>Wed, 03 Apr 2013 02:46:31 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2013-04-03T02:46:31Z</dc:date>
    <item>
      <title>alter table command not working on a particular table</title>
      <link>https://community.sap.com/t5/technology-q-a/alter-table-command-not-working-on-a-particular-table/qaq-p/13813295</link>
      <description>&lt;P&gt;Hi,
    I am trying to run alter table command on a particular able to add a column to it using the following command:&lt;/P&gt;
&lt;DIV class="codehilite"&gt;&lt;PRE&gt;&lt;SPAN class="o"&gt;***&lt;/SPAN&gt;&lt;SPAN class="n"&gt;alter&lt;/SPAN&gt; &lt;SPAN class="n"&gt;table&lt;/SPAN&gt; &lt;SPAN class="n"&gt;tab_name&lt;/SPAN&gt; &lt;SPAN class="n"&gt;add&lt;/SPAN&gt; &lt;SPAN class="n"&gt;col_name&lt;/SPAN&gt; &lt;SPAN class="nb"&gt;int&lt;/SPAN&gt;&lt;SPAN class="o"&gt;***&lt;/SPAN&gt;
&lt;/PRE&gt;&lt;/DIV&gt;


&lt;P&gt;And after typing the command when click Run button, the command keeps on running and doesn't stop even after a long time.And if i manually stop it nothings happens to be done.&lt;/P&gt;
&lt;P&gt;But i am able to alter table with the same command on any other table but not on this particular table.&lt;/P&gt;
&lt;P&gt;Any ideas where i can be doing wrong, what should i check or edit any settings. or What can be the possible reasons i am not able to run alter table command on a particular table.&lt;/P&gt;
&lt;P&gt;regards,
satyam&lt;/P&gt;</description>
      <pubDate>Sun, 31 Mar 2013 01:54:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/alter-table-command-not-working-on-a-particular-table/qaq-p/13813295</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2013-03-31T01:54:51Z</dc:date>
    </item>
    <item>
      <title>Re: alter table command not working on a particular table</title>
      <link>https://community.sap.com/t5/technology-q-a/alter-table-command-not-working-on-a-particular-table/qaa-p/13813296#M4844139</link>
      <description>&lt;P&gt;See &lt;A href="http://sqlanywhere-forum.sap.com/questions/16106/asa-7-alter-table"&gt;http://sqlanywhere-forum.sap.com/questions/16106/asa-7-alter-table&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;The comments there apply to all versions prior to 16. Either your ALTER statement is waiting for a lock because another connection has an uncommitted transaction that references the table you are trying to alter or the table is large and the server is busy rewriting all of the rows of the table.&lt;/P&gt;</description>
      <pubDate>Sun, 31 Mar 2013 07:12:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/alter-table-command-not-working-on-a-particular-table/qaa-p/13813296#M4844139</guid>
      <dc:creator>johnsmirnios</dc:creator>
      <dc:date>2013-03-31T07:12:31Z</dc:date>
    </item>
    <item>
      <title>Re: alter table command not working on a particular table</title>
      <link>https://community.sap.com/t5/technology-q-a/alter-table-command-not-working-on-a-particular-table/qaa-p/13813297#M4844140</link>
      <description>&lt;P&gt;To emphasize John's reply: all it takes is a SELECT statement on some other connection to prevent ALTER TABLE from running... close that other connection or run a COMMIT to release the schema lock.&lt;/P&gt;</description>
      <pubDate>Sun, 31 Mar 2013 09:10:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/alter-table-command-not-working-on-a-particular-table/qaa-p/13813297#M4844140</guid>
      <dc:creator>Breck_Carter</dc:creator>
      <dc:date>2013-03-31T09:10:00Z</dc:date>
    </item>
    <item>
      <title>Re: alter table command not working on a particular table</title>
      <link>https://community.sap.com/t5/technology-q-a/alter-table-command-not-working-on-a-particular-table/qaa-p/13813298#M4844141</link>
      <description>&lt;P&gt;Even after running commit command i am not able to run alter table command it is going in infinite loop, is there any other command to close all open connections.&lt;/P&gt;</description>
      <pubDate>Wed, 03 Apr 2013 02:00:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/alter-table-command-not-working-on-a-particular-table/qaa-p/13813298#M4844141</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2013-04-03T02:00:59Z</dc:date>
    </item>
    <item>
      <title>Re: alter table command not working on a particular table</title>
      <link>https://community.sap.com/t5/technology-q-a/alter-table-command-not-working-on-a-particular-table/qaa-p/13813299#M4844142</link>
      <description>&lt;P&gt;Actually the thing is my one application connects to database server but at the same time i am trying to run alter table command from my C code using unixodbc by creating new connection to the database. But i am not able to do so as it goes in infinite loop and my code doesn't go beyond alter table command that means it is having the same effect as if i try to alter table from dbisql when my application is connected to the database.&lt;/P&gt;
&lt;P&gt;But i am able to use update or select command from my C ODBC code by creating the a new connection but alter is not working.&lt;/P&gt;
&lt;P&gt;Is there some command i should run before running alter as i cannot close the other database connection.&lt;/P&gt;</description>
      <pubDate>Wed, 03 Apr 2013 02:46:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/alter-table-command-not-working-on-a-particular-table/qaa-p/13813299#M4844142</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2013-04-03T02:46:31Z</dc:date>
    </item>
    <item>
      <title>Re: alter table command not working on a particular table</title>
      <link>https://community.sap.com/t5/technology-q-a/alter-table-command-not-working-on-a-particular-table/qaa-p/13813300#M4844143</link>
      <description>&lt;P&gt;If any connection is holding on to table schema locks (e.g. there is an open transaction / cursor), you will not be able to run the &lt;CODE&gt;ALTER&lt;/CODE&gt; command. You should check &lt;CODE&gt;sa_locks()&lt;/CODE&gt; ( &lt;A href="http://dcx.sybase.com/index.html#sa160/en/dbreference/sa-locks-system-procedure.html"&gt;http://dcx.sybase.com/index.html#sa160/en/dbreference/sa-locks-system-procedure.html&lt;/A&gt; ) to confirm if there are any open table schema locks on this table from your other connection.&lt;/P&gt;
&lt;P&gt;Another point is that this is not an 'infinite loop' scenario - as John commented, you are either &lt;A href="http://dcx.sybase.com/index.html#sa160/en/dbusage/trblock.html"&gt;blocked&lt;/A&gt; or you are asking the server to perform a large amount of work and you are not giving it enough time to complete.&lt;/P&gt;
&lt;HR /&gt;
&lt;P&gt;Database connections can be forcibly dropped using the &lt;CODE&gt;DROP CONNECTION&lt;/CODE&gt; SQL command. ( &lt;A href="http://dcx.sybase.com/index.html#sa160/en/dbreference/drop-connection-statement.html"&gt;http://dcx.sybase.com/index.html#sa160/en/dbreference/drop-connection-statement.html&lt;/A&gt; ).&lt;/P&gt;</description>
      <pubDate>Wed, 03 Apr 2013 10:11:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/alter-table-command-not-working-on-a-particular-table/qaa-p/13813300#M4844143</guid>
      <dc:creator>jeff_albion</dc:creator>
      <dc:date>2013-04-03T10:11:16Z</dc:date>
    </item>
    <item>
      <title>Re: alter table command not working on a particular table</title>
      <link>https://community.sap.com/t5/technology-q-a/alter-table-command-not-working-on-a-particular-table/qaa-p/13813301#M4844144</link>
      <description>&lt;P&gt;Thankyou this will help i guess. One last thing i need to ask is there any way to use where clause as i need to select the row where LockTable='something'&lt;/P&gt;</description>
      <pubDate>Thu, 04 Apr 2013 03:38:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/alter-table-command-not-working-on-a-particular-table/qaa-p/13813301#M4844144</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2013-04-04T03:38:38Z</dc:date>
    </item>
    <item>
      <title>Re: alter table command not working on a particular table</title>
      <link>https://community.sap.com/t5/technology-q-a/alter-table-command-not-working-on-a-particular-table/qaa-p/13813302#M4844145</link>
      <description>&lt;P&gt;select * from sa_locks() where table_name = 'YourTableName'&lt;/P&gt;</description>
      <pubDate>Thu, 04 Apr 2013 03:43:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/alter-table-command-not-working-on-a-particular-table/qaa-p/13813302#M4844145</guid>
      <dc:creator>reimer_pods</dc:creator>
      <dc:date>2013-04-04T03:43:22Z</dc:date>
    </item>
  </channel>
</rss>

