<?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: SQL Anywhere adding LAST_MODIFIED column to tables. in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/sql-anywhere-adding-last-modified-column-to-tables/qaa-p/13849728#M4880571</link>
    <description>&lt;P&gt;I assume the &lt;CODE&gt;LAST_MODIFIED&lt;/CODE&gt; column was added when you deployed a MobiLink synchronization model with default options for timestamp download. If you don't want to have that column added to the table, you can change the synchronization model to instead use a shadow table for the &lt;CODE&gt;LAST_MODIFIED&lt;/CODE&gt; column. That choice can be made in the &lt;A href="http://dcx.sybase.com/index.html#1201/en/sacshelp/ml-syncmodel-wiz-download-type-timestamp.html"&gt;wizard&lt;/A&gt; or afterward in the &lt;A href="http://dcx.sybase.com/index.html#1201/en/sacshelp/ml-download-type-settings-editor.html"&gt;Download options&lt;/A&gt; for a table mapping.&lt;/P&gt;</description>
    <pubDate>Thu, 20 Oct 2011 15:08:59 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2011-10-20T15:08:59Z</dc:date>
    <item>
      <title>SQL Anywhere adding LAST_MODIFIED column to tables.</title>
      <link>https://community.sap.com/t5/technology-q-a/sql-anywhere-adding-last-modified-column-to-tables/qaq-p/13849727</link>
      <description>&lt;P&gt;I am working on a huge, messy, old and very ugly legacy system.  We have created a remote application and are using UltraLIte as our DB there.  Several of the forms in our system use INSERT statements without a list of columns.  Now that SQL Anywhere has added this new column to the tables I am getting a mismatched columns error (ORA-009947).&lt;/P&gt;
&lt;P&gt;So for example we have:&lt;/P&gt;
&lt;DIV class="codehilite"&gt;&lt;PRE&gt; &lt;SPAN class="n"&gt;INSERT&lt;/SPAN&gt; &lt;SPAN class="n"&gt;INTIO&lt;/SPAN&gt; &lt;SPAN class="n"&gt;table&lt;/SPAN&gt; &lt;SPAN class="p"&gt;(&lt;/SPAN&gt;&lt;SPAN class="n"&gt;SELECT&lt;/SPAN&gt; &lt;SPAN class="n"&gt;col1&lt;/SPAN&gt;&lt;SPAN class="p"&gt;,&lt;/SPAN&gt; &lt;SPAN class="n"&gt;col2&lt;/SPAN&gt;&lt;SPAN class="p"&gt;,&lt;/SPAN&gt; &lt;SPAN class="n"&gt;col3&lt;/SPAN&gt; &lt;SPAN class="n"&gt;FROM&lt;/SPAN&gt; &lt;SPAN class="n"&gt;table2&lt;/SPAN&gt;&lt;SPAN class="p"&gt;)&lt;/SPAN&gt;
&lt;/PRE&gt;&lt;/DIV&gt;


&lt;P&gt;We should have:&lt;/P&gt;
&lt;DIV class="codehilite"&gt;&lt;PRE&gt; &lt;SPAN class="n"&gt;INSERT&lt;/SPAN&gt; &lt;SPAN class="n"&gt;INTO&lt;/SPAN&gt; &lt;SPAN class="n"&gt;table&lt;/SPAN&gt; &lt;SPAN class="p"&gt;(&lt;/SPAN&gt;&lt;SPAN class="n"&gt;cola&lt;/SPAN&gt;&lt;SPAN class="p"&gt;,&lt;/SPAN&gt; &lt;SPAN class="n"&gt;colb&lt;/SPAN&gt;&lt;SPAN class="p"&gt;,&lt;/SPAN&gt; &lt;SPAN class="n"&gt;colc&lt;/SPAN&gt;&lt;SPAN class="p"&gt;)&lt;/SPAN&gt; &lt;SPAN class="p"&gt;(&lt;/SPAN&gt;&lt;SPAN class="n"&gt;SELECT&lt;/SPAN&gt; &lt;SPAN class="n"&gt;col1&lt;/SPAN&gt;&lt;SPAN class="p"&gt;,&lt;/SPAN&gt; &lt;SPAN class="n"&gt;col2&lt;/SPAN&gt;&lt;SPAN class="p"&gt;,&lt;/SPAN&gt; &lt;SPAN class="n"&gt;col3&lt;/SPAN&gt; &lt;SPAN class="n"&gt;from&lt;/SPAN&gt; &lt;SPAN class="n"&gt;table2&lt;/SPAN&gt;&lt;SPAN class="p"&gt;)&lt;/SPAN&gt;
&lt;/PRE&gt;&lt;/DIV&gt;


&lt;P&gt;One solution to the problem will be to modify the INSERT statements in the forms to have the list of columns, but if we do that it adds a lot more work and testing to the project.&lt;/P&gt;
&lt;P&gt;Is there a way to create the SQLAnywhere system without having the LAST_MODIFIED column added to the DB tables?&lt;/P&gt;</description>
      <pubDate>Thu, 20 Oct 2011 14:19:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sql-anywhere-adding-last-modified-column-to-tables/qaq-p/13849727</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-10-20T14:19:03Z</dc:date>
    </item>
    <item>
      <title>Re: SQL Anywhere adding LAST_MODIFIED column to tables.</title>
      <link>https://community.sap.com/t5/technology-q-a/sql-anywhere-adding-last-modified-column-to-tables/qaa-p/13849729#M4880572</link>
      <description>&lt;P&gt;A wild guess: Possibly adding a ", NULL" to your SELECT statement might help: If the LAST_MODIFIED column is the last in the table's order and has a DEFAULT value, that would insert that default.&lt;/P&gt;</description>
      <pubDate>Thu, 20 Oct 2011 14:29:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sql-anywhere-adding-last-modified-column-to-tables/qaa-p/13849729#M4880572</guid>
      <dc:creator>VolkerBarth</dc:creator>
      <dc:date>2011-10-20T14:29:36Z</dc:date>
    </item>
    <item>
      <title>Re: SQL Anywhere adding LAST_MODIFIED column to tables.</title>
      <link>https://community.sap.com/t5/technology-q-a/sql-anywhere-adding-last-modified-column-to-tables/qaa-p/13849728#M4880571</link>
      <description>&lt;P&gt;I assume the &lt;CODE&gt;LAST_MODIFIED&lt;/CODE&gt; column was added when you deployed a MobiLink synchronization model with default options for timestamp download. If you don't want to have that column added to the table, you can change the synchronization model to instead use a shadow table for the &lt;CODE&gt;LAST_MODIFIED&lt;/CODE&gt; column. That choice can be made in the &lt;A href="http://dcx.sybase.com/index.html#1201/en/sacshelp/ml-syncmodel-wiz-download-type-timestamp.html"&gt;wizard&lt;/A&gt; or afterward in the &lt;A href="http://dcx.sybase.com/index.html#1201/en/sacshelp/ml-download-type-settings-editor.html"&gt;Download options&lt;/A&gt; for a table mapping.&lt;/P&gt;</description>
      <pubDate>Thu, 20 Oct 2011 15:08:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sql-anywhere-adding-last-modified-column-to-tables/qaa-p/13849728#M4880571</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-10-20T15:08:59Z</dc:date>
    </item>
    <item>
      <title>Re: SQL Anywhere adding LAST_MODIFIED column to tables.</title>
      <link>https://community.sap.com/t5/technology-q-a/sql-anywhere-adding-last-modified-column-to-tables/qaa-p/13849730#M4880573</link>
      <description>&lt;P&gt;FYI, since this is a forum specific to SQL Anywhere, you usually don't need to add a sqlanywhere tag to questions. I did add a mobilink tag to this and another question you asked, since both are related to MobiLink.&lt;/P&gt;</description>
      <pubDate>Thu, 20 Oct 2011 15:12:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sql-anywhere-adding-last-modified-column-to-tables/qaa-p/13849730#M4880573</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-10-20T15:12:42Z</dc:date>
    </item>
    <item>
      <title>Re: SQL Anywhere adding LAST_MODIFIED column to tables.</title>
      <link>https://community.sap.com/t5/technology-q-a/sql-anywhere-adding-last-modified-column-to-tables/qaa-p/13849731#M4880574</link>
      <description>&lt;P&gt;Ummmmm... if the download_cursor scripts are using LAST_MODIFIED to cut the download stream size, dumping that column might be fatal to synchronization performance... what you are suggesting in effect is for them to switch to "download all rows all the time" &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Since your answer got the Big Green Checkmark, I assume getting rid of LAST_MODIFIED is appropriate in the case... but for OTHER PEOPLE, switching to a shadow table for the LAST_MODIFIED column might be more appropriate. The usual reason for that is "Oracle DBA".&lt;/P&gt;</description>
      <pubDate>Fri, 21 Oct 2011 06:43:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sql-anywhere-adding-last-modified-column-to-tables/qaa-p/13849731#M4880574</guid>
      <dc:creator>Breck_Carter</dc:creator>
      <dc:date>2011-10-21T06:43:26Z</dc:date>
    </item>
    <item>
      <title>Re: SQL Anywhere adding LAST_MODIFIED column to tables.</title>
      <link>https://community.sap.com/t5/technology-q-a/sql-anywhere-adding-last-modified-column-to-tables/qaa-p/13849732#M4880575</link>
      <description>&lt;P&gt;Check again. The LAST_MODIFIED column is still there, but in a shadow table column with a foreign key to the original table. The previous download_cursor query just needs to be converted to a join.&lt;/P&gt;</description>
      <pubDate>Fri, 21 Oct 2011 10:17:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sql-anywhere-adding-last-modified-column-to-tables/qaa-p/13849732#M4880575</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-10-21T10:17:16Z</dc:date>
    </item>
    <item>
      <title>Re: SQL Anywhere adding LAST_MODIFIED column to tables.</title>
      <link>https://community.sap.com/t5/technology-q-a/sql-anywhere-adding-last-modified-column-to-tables/qaa-p/13849733#M4880576</link>
      <description>&lt;P&gt;As Russ has pointed out, I did suggest moving the column to a shadow table. To get rid of the column completely and "download all rows all the time" you would choose snapshot download instead of timestamp-based download in the sync model, but I didn't suggest that.&lt;/P&gt;
&lt;P&gt;When using a shadow table for timestamp-based download (as I suggested), the generated download_cursor would use the LAST_MODIFIED column in the shadow table through a join.&lt;/P&gt;
&lt;P&gt;I also assumed that the project is still in development, so that he could deploy to a "clean" consolidated (i.e. without needing to keep LAST_MODIFIED column values or drop that column). But even if moving the column to a shadow table lost all the existing values and the shadow table's columns were initialized to 1900-01-01, all rows would only be downloaded once, not all the time.&lt;/P&gt;</description>
      <pubDate>Fri, 21 Oct 2011 13:54:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sql-anywhere-adding-last-modified-column-to-tables/qaa-p/13849733#M4880576</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-10-21T13:54:08Z</dc:date>
    </item>
  </channel>
</rss>

