<?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>topic Dynamic Update Question in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Dynamic-Update-Question/m-p/185968#M50272</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hi to all,&lt;/P&gt;&lt;P&gt;I have a problem using Dynamic Update Command. I need to insert all the rows of a linear table into another one. I did it with a &lt;I&gt;&lt;/I&gt;for .. next statement&lt;/P&gt;&lt;P&gt;The macro is here below&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sub list&lt;/P&gt;&lt;P&gt;Dim strsql&lt;/P&gt;&lt;P&gt;set obj = ActiveDocument.GetSheetObject("CH02")&lt;/P&gt;&lt;P&gt;MsgBox ("number of rows " &amp;amp; obj.GetRowCount-1)&lt;/P&gt;&lt;P&gt;set curDoc = ActiveDocument.GetProperties&lt;/P&gt;&lt;P&gt;curDoc.EnableDynamicDataUpdate=true&lt;/P&gt;&lt;P&gt;ActiveDocument.SetProperties curDoc&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for RowIter = 2 to obj.GetRowCount-1&lt;/P&gt;&lt;P&gt;set cell = obj.GetCell(RowIter,1)&lt;/P&gt;&lt;P&gt;set cell2 = obj.GetCell(RowIter,10)&lt;/P&gt;&lt;P&gt;MsgBox(RowIter &amp;amp; " " &amp;amp; cell.Text &amp;amp; " " &amp;amp; cell2.Text)&lt;/P&gt;&lt;P&gt;strsql = "INSERT INTO prova (monthyear, percentualeRientri) VALUES ('"&amp;amp; cell.Text &amp;amp; "','" &amp;amp;cell2.Text &amp;amp;"')"&lt;/P&gt;&lt;P&gt;set Result = ActiveDocument.DynamicUpdateCommand (strsql)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if Result = false then&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MsgBox Result.ErrorMessage&lt;/P&gt;&lt;P&gt;end if&lt;/P&gt;&lt;P&gt;next&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ActiveDocument.Save&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;end sub&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BR class="Apple-interchange-newline" /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 14 Sep 2009 22:19:46 GMT</pubDate>
    <dc:creator />
    <dc:date>2009-09-14T22:19:46Z</dc:date>
    <item>
      <title>Dynamic Update Question</title>
      <link>https://community.qlik.com/t5/QlikView/Dynamic-Update-Question/m-p/185968#M50272</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hi to all,&lt;/P&gt;&lt;P&gt;I have a problem using Dynamic Update Command. I need to insert all the rows of a linear table into another one. I did it with a &lt;I&gt;&lt;/I&gt;for .. next statement&lt;/P&gt;&lt;P&gt;The macro is here below&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sub list&lt;/P&gt;&lt;P&gt;Dim strsql&lt;/P&gt;&lt;P&gt;set obj = ActiveDocument.GetSheetObject("CH02")&lt;/P&gt;&lt;P&gt;MsgBox ("number of rows " &amp;amp; obj.GetRowCount-1)&lt;/P&gt;&lt;P&gt;set curDoc = ActiveDocument.GetProperties&lt;/P&gt;&lt;P&gt;curDoc.EnableDynamicDataUpdate=true&lt;/P&gt;&lt;P&gt;ActiveDocument.SetProperties curDoc&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for RowIter = 2 to obj.GetRowCount-1&lt;/P&gt;&lt;P&gt;set cell = obj.GetCell(RowIter,1)&lt;/P&gt;&lt;P&gt;set cell2 = obj.GetCell(RowIter,10)&lt;/P&gt;&lt;P&gt;MsgBox(RowIter &amp;amp; " " &amp;amp; cell.Text &amp;amp; " " &amp;amp; cell2.Text)&lt;/P&gt;&lt;P&gt;strsql = "INSERT INTO prova (monthyear, percentualeRientri) VALUES ('"&amp;amp; cell.Text &amp;amp; "','" &amp;amp;cell2.Text &amp;amp;"')"&lt;/P&gt;&lt;P&gt;set Result = ActiveDocument.DynamicUpdateCommand (strsql)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if Result = false then&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MsgBox Result.ErrorMessage&lt;/P&gt;&lt;P&gt;end if&lt;/P&gt;&lt;P&gt;next&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ActiveDocument.Save&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;end sub&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BR class="Apple-interchange-newline" /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Sep 2009 22:19:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Dynamic-Update-Question/m-p/185968#M50272</guid>
      <dc:creator />
      <dc:date>2009-09-14T22:19:46Z</dc:date>
    </item>
  </channel>
</rss>

