<?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: Does ALTER TABLE impact DEFAULT TIMESTAMP columns? in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/does-alter-table-impact-default-timestamp-columns/qaa-p/13834287#M4865130</link>
    <description>&lt;P&gt;Being no iAnywhere staff member, obviously I can't claim whether this is intended behaviour or not.&lt;/P&gt;

&lt;P&gt;That being said, I &lt;STRONG&gt;suggest that the current behaviour should be documented&lt;/STRONG&gt;, as changing rows by ALTERing the table seems quite similar to changing rows by updates. Therefore I guess my question is not too uncommon.&lt;/P&gt;

&lt;P&gt;However, I bet in most cases DEFAULT TIMESTAMP is used to track changes by ordinary DML statements - in the sense of "when was that row modified at last". It's usually meant for changes by users / application programs.&lt;/P&gt;

&lt;P&gt;When doing &lt;STRONG&gt;clean-up or other administrative tasks&lt;/STRONG&gt; in such tables, I often want the particular DEFAULT TIMESTAMP column to &lt;STRONG&gt;stay unchanged&lt;/STRONG&gt; to "hide" my adminstrative changes. That's easily done with an UPDATE statement that sets the DEFAULT TIMESTAMP column to its current value. And as usually, if the UPDATE statement specifies a value for this column, the default value isn't applied.&lt;/P&gt;

&lt;P&gt;So, with UPDATE, I'm quite free to choose whether I want DEFAULT TIMESTAMP to be updated or not.&lt;/P&gt;

&lt;HR /&gt;

&lt;P&gt;However, if ALTER TABLE would change the DEFAULT TIMESTAMP, there wouldn't be a way to prevent this change (at least without an enhanced syntax). Therefore &lt;STRONG&gt;the current behaviour seems reasonable&lt;/STRONG&gt; as&lt;/P&gt;

&lt;OL&gt;
&lt;LI&gt;&lt;P&gt;table alterations (as truly administrative tasks) might usually not be meant to change the timestamp and&lt;/P&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;P&gt;in case the timestamp should be changed, one can still achieve this by adding an according UPDATE STATEMENT afterwards.&lt;/P&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;P&gt;Furthermore an ALTER TABLE &lt;EM&gt;with&lt;/EM&gt; impact on DEFAULT TIMESTAMP could raise problems in &lt;STRONG&gt;replication/synchronization setups&lt;/STRONG&gt;: In such setups, ALTER TABLE is usually done at different times at different locations for the same (distributed) rows, and that would lead to multiple changes of the timestamp column for the same row. That might be difficult to handle. At least, such a behaviour doesn't seem senseful to me.&lt;/P&gt;&lt;/LI&gt;
&lt;/OL&gt;</description>
    <pubDate>Fri, 07 Jan 2011 22:28:08 GMT</pubDate>
    <dc:creator>VolkerBarth</dc:creator>
    <dc:date>2011-01-07T22:28:08Z</dc:date>
    <item>
      <title>Does ALTER TABLE impact DEFAULT TIMESTAMP columns?</title>
      <link>https://community.sap.com/t5/technology-q-a/does-alter-table-impact-default-timestamp-columns/qaq-p/13834286</link>
      <description>&lt;P&gt;I'm just altering the COMPUTE expression of a table with existing data. (This is V12.0.0.2601.)&lt;/P&gt;

&lt;P&gt;&lt;A href="http://dcx.sybase.com/index.html#1200en/dbusage/workingwdb-sectb-3277570.html" rel="nofollow" target="_blank"&gt;As documented&lt;/A&gt;, this re-computes not only the particular column addressed in the ALTER TABLE ... SET COMPUTE statement but does &lt;EM&gt;re-compute all computed columns&lt;/EM&gt; in this table (and in this case, this is absolutely wanted behaviour:).&lt;/P&gt;

&lt;P&gt;Since the table has the usual &lt;A href="http://dcx.sybase.com/index.html#1200en/dbreference/timestamp-special-value.html" rel="nofollow" target="_blank"&gt;DEFAULT TIMESTAMP column&lt;/A&gt;, I wasn't sure if this column is changed, too - however, it isn't.&lt;/P&gt;

&lt;P&gt;Is this expected behaviour for &lt;STRONG&gt;DEFAULT TIMESTAMP&lt;/STRONG&gt;, i.e. will those values &lt;STRONG&gt;only change by UPDATE statements&lt;/STRONG&gt;, but not by those data modifications as result of an &lt;STRONG&gt;ALTER TABLE statement&lt;/STRONG&gt; (e.g. altering computed values, adding columns with defaults and the like)?&lt;/P&gt;

&lt;HR /&gt;

&lt;P&gt;I'm just asking for a better understanding...&lt;/P&gt;</description>
      <pubDate>Wed, 05 Jan 2011 15:20:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/does-alter-table-impact-default-timestamp-columns/qaq-p/13834286</guid>
      <dc:creator>VolkerBarth</dc:creator>
      <dc:date>2011-01-05T15:20:15Z</dc:date>
    </item>
    <item>
      <title>Re: Does ALTER TABLE impact DEFAULT TIMESTAMP columns?</title>
      <link>https://community.sap.com/t5/technology-q-a/does-alter-table-impact-default-timestamp-columns/qaa-p/13834287#M4865130</link>
      <description>&lt;P&gt;Being no iAnywhere staff member, obviously I can't claim whether this is intended behaviour or not.&lt;/P&gt;

&lt;P&gt;That being said, I &lt;STRONG&gt;suggest that the current behaviour should be documented&lt;/STRONG&gt;, as changing rows by ALTERing the table seems quite similar to changing rows by updates. Therefore I guess my question is not too uncommon.&lt;/P&gt;

&lt;P&gt;However, I bet in most cases DEFAULT TIMESTAMP is used to track changes by ordinary DML statements - in the sense of "when was that row modified at last". It's usually meant for changes by users / application programs.&lt;/P&gt;

&lt;P&gt;When doing &lt;STRONG&gt;clean-up or other administrative tasks&lt;/STRONG&gt; in such tables, I often want the particular DEFAULT TIMESTAMP column to &lt;STRONG&gt;stay unchanged&lt;/STRONG&gt; to "hide" my adminstrative changes. That's easily done with an UPDATE statement that sets the DEFAULT TIMESTAMP column to its current value. And as usually, if the UPDATE statement specifies a value for this column, the default value isn't applied.&lt;/P&gt;

&lt;P&gt;So, with UPDATE, I'm quite free to choose whether I want DEFAULT TIMESTAMP to be updated or not.&lt;/P&gt;

&lt;HR /&gt;

&lt;P&gt;However, if ALTER TABLE would change the DEFAULT TIMESTAMP, there wouldn't be a way to prevent this change (at least without an enhanced syntax). Therefore &lt;STRONG&gt;the current behaviour seems reasonable&lt;/STRONG&gt; as&lt;/P&gt;

&lt;OL&gt;
&lt;LI&gt;&lt;P&gt;table alterations (as truly administrative tasks) might usually not be meant to change the timestamp and&lt;/P&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;P&gt;in case the timestamp should be changed, one can still achieve this by adding an according UPDATE STATEMENT afterwards.&lt;/P&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;P&gt;Furthermore an ALTER TABLE &lt;EM&gt;with&lt;/EM&gt; impact on DEFAULT TIMESTAMP could raise problems in &lt;STRONG&gt;replication/synchronization setups&lt;/STRONG&gt;: In such setups, ALTER TABLE is usually done at different times at different locations for the same (distributed) rows, and that would lead to multiple changes of the timestamp column for the same row. That might be difficult to handle. At least, such a behaviour doesn't seem senseful to me.&lt;/P&gt;&lt;/LI&gt;
&lt;/OL&gt;</description>
      <pubDate>Fri, 07 Jan 2011 22:28:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/does-alter-table-impact-default-timestamp-columns/qaa-p/13834287#M4865130</guid>
      <dc:creator>VolkerBarth</dc:creator>
      <dc:date>2011-01-07T22:28:08Z</dc:date>
    </item>
    <item>
      <title>Re: Does ALTER TABLE impact DEFAULT TIMESTAMP columns?</title>
      <link>https://community.sap.com/t5/technology-q-a/does-alter-table-impact-default-timestamp-columns/qaa-p/13834288#M4865131</link>
      <description>&lt;P&gt;I think ALTER TABLE should not affect DEFAULT TIMESTAMP columns for the very reason yo've described ;).&lt;/P&gt;</description>
      <pubDate>Sun, 09 Jan 2011 17:15:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/does-alter-table-impact-default-timestamp-columns/qaa-p/13834288#M4865131</guid>
      <dc:creator>former_SQLA_member1694880</dc:creator>
      <dc:date>2011-01-09T17:15:44Z</dc:date>
    </item>
    <item>
      <title>Re: Does ALTER TABLE impact DEFAULT TIMESTAMP columns?</title>
      <link>https://community.sap.com/t5/technology-q-a/does-alter-table-impact-default-timestamp-columns/qaa-p/13834289#M4865132</link>
      <description>&lt;P&gt;@Dmitri: That's exactly what I have tried to express: Yes, the current behaviour seems senseful - it should just be documented...&lt;/P&gt;</description>
      <pubDate>Sun, 09 Jan 2011 20:56:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/does-alter-table-impact-default-timestamp-columns/qaa-p/13834289#M4865132</guid>
      <dc:creator>VolkerBarth</dc:creator>
      <dc:date>2011-01-09T20:56:25Z</dc:date>
    </item>
  </channel>
</rss>

