<?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 Re: Insert into Sql table using Macro in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Insert-into-Sql-table-using-Macro/m-p/1306929#M406672</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;From the APIGuide:&lt;/P&gt;&lt;P&gt;set v = ActiveDocument.Variables("Variable1")&lt;/P&gt;&lt;P&gt;msgbox(v.GetContent.String)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 16 Jun 2017 16:41:12 GMT</pubDate>
    <dc:creator>m_woolf</dc:creator>
    <dc:date>2017-06-16T16:41:12Z</dc:date>
    <item>
      <title>Insert into Sql table using Macro</title>
      <link>https://community.qlik.com/t5/QlikView/Insert-into-Sql-table-using-Macro/m-p/1306928#M406671</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All&lt;/P&gt;&lt;P&gt;Need your help please.I am trying to update a Field in Qlikview table using a Variable and then i am Trying to write that variable value in a SQL table so that can use that value to populate the Table on reload: I am using below Macro. I am getting an Error message when i try to Insert Variable value into Table (Highlighted Red) &lt;SPAN style="color: #ff0000;"&gt;[Object doesn't support this property or method: 'val2.Item' ]&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;This syntax works fine when i use a value without a variable but using variable throws error message:&lt;/P&gt;&lt;P&gt;Probably code needs a bit of tweaking &lt;SPAN style="color: #ff0000;"&gt;val2.Item(i).Text &lt;/SPAN&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sub QV2SQL &lt;BR /&gt; SET Connection= GetAgentConnection() &lt;BR /&gt; dim uSQL&lt;BR /&gt; dim RegAfectados&lt;BR /&gt; dim importe&lt;BR /&gt; Dim Ibox1&lt;BR /&gt; RegAfectados = 0&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; set val=ActiveDocument.Fields("ID").GetPossibleValues&lt;BR /&gt; set val2 = ActiveDocument.Variables("vValue")&lt;BR /&gt; Ibox1=val2.GetContent.String&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; for i=0 to val.Count-1&lt;BR /&gt; Connection.Execute "INSERT INTO [dbo].[DQ_Challenges_Validated_Data] ([Pk_ID],[Feedback_ID]) VALUES ('" &amp;amp; val.Item(i).Text &amp;amp; "', '" &amp;amp;&amp;nbsp; &lt;SPAN style="color: #ff0000;"&gt;val2.Item(i).Text &lt;/SPAN&gt;&amp;amp; "')"&lt;BR /&gt; next&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; End Sub &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Jun 2017 15:44:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Insert-into-Sql-table-using-Macro/m-p/1306928#M406671</guid>
      <dc:creator />
      <dc:date>2017-06-16T15:44:27Z</dc:date>
    </item>
    <item>
      <title>Re: Insert into Sql table using Macro</title>
      <link>https://community.qlik.com/t5/QlikView/Insert-into-Sql-table-using-Macro/m-p/1306929#M406672</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;From the APIGuide:&lt;/P&gt;&lt;P&gt;set v = ActiveDocument.Variables("Variable1")&lt;/P&gt;&lt;P&gt;msgbox(v.GetContent.String)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Jun 2017 16:41:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Insert-into-Sql-table-using-Macro/m-p/1306929#M406672</guid>
      <dc:creator>m_woolf</dc:creator>
      <dc:date>2017-06-16T16:41:12Z</dc:date>
    </item>
  </channel>
</rss>

