<?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 performance problem about inserting qv selections to database via macro in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/performance-problem-about-inserting-qv-selections-to-database/m-p/206572#M62648</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;i wrote a macro for creating table and inserting selections in qv to a database.that s all right.it works without any problem.BUT there is a problem about its performance.if you write only 100 rows, it works well.it does this job in a few seconds.but if you want to write data like 100.000 rows it works too slowly.i didnt wait but i can say that it may last aprx 60-70 mins.&lt;/P&gt;&lt;P&gt;does anybody know how to increase writng speed? or can i do the same job with another application?&lt;/P&gt;&lt;P&gt;you can find the code works here:&lt;/P&gt;&lt;P&gt;sub dbCreateInsert&lt;/P&gt;&lt;P&gt;dim sConn, oRS, sSQL1,sSQL2,var1&lt;BR /&gt;set var1= ActiveDocument.Variables("VARIABLE")&lt;BR /&gt;var1 = ActiveDocument.Variables("VARIABLE").GetContent().string&lt;BR /&gt;set doc = ActiveDocument&lt;BR /&gt;Set sConn = CreateObject("ADODB.Connection")&lt;BR /&gt;sConn.Open "Provider=OraOLEDB.Oracle.1;Persist Security Info=False;User ID=USERNAME;Password=PASSWORD;Data Source=DBNAME;"&lt;BR /&gt;set oRS =CreateObject("ADODB.Recordset")&lt;/P&gt;&lt;P&gt;'creating table with name gettiing from variable&lt;BR /&gt; sSQL1="CREATE TABLE " &amp;amp; var1 &amp;amp; " (CUSTOMERID varchar(20))"&lt;BR /&gt; set oRS = sConn.execute(sSQL1)&lt;/P&gt;&lt;P&gt;'selecting all different rows&lt;BR /&gt; set cLoRecord=doc.Fields("CUSTOMERID _NO").GetPossibleValues()&lt;BR /&gt; for i=0 to cLoRecord.Count-1&lt;BR /&gt; vRecord = cLoRecord.Item(i).Text&lt;BR /&gt; doc.Fields("CUSTOMERID _NO").Select vRecord&lt;/P&gt;&lt;P&gt;set CM1 = doc.Fields("CUSTOMERID").GetPossibleValues()&lt;BR /&gt; vm1 = cM1.item(0).Text&lt;/P&gt;&lt;P&gt;' writing to db&lt;BR /&gt; sSQL2="INSERT INTO " &amp;amp; var1 &amp;amp; " (CUSTOMERID ) VALUES (" &amp;amp; "'" &amp;amp; vm1 &amp;amp; "')"&lt;BR /&gt; set oRS = sConn.execute(sSQL2)&lt;BR /&gt; next&lt;/P&gt;&lt;P&gt;'warning after writing&lt;BR /&gt;doc.ClearAll&lt;BR /&gt;msgbox("all your selectins has been written")&lt;BR /&gt;set oRS = Nothing&lt;BR /&gt;set sConn = Nothing&lt;/P&gt;&lt;P&gt;end sub&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 30 Nov 2010 15:28:38 GMT</pubDate>
    <dc:creator />
    <dc:date>2010-11-30T15:28:38Z</dc:date>
    <item>
      <title>performance problem about inserting qv selections to database via macro</title>
      <link>https://community.qlik.com/t5/QlikView/performance-problem-about-inserting-qv-selections-to-database/m-p/206572#M62648</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;i wrote a macro for creating table and inserting selections in qv to a database.that s all right.it works without any problem.BUT there is a problem about its performance.if you write only 100 rows, it works well.it does this job in a few seconds.but if you want to write data like 100.000 rows it works too slowly.i didnt wait but i can say that it may last aprx 60-70 mins.&lt;/P&gt;&lt;P&gt;does anybody know how to increase writng speed? or can i do the same job with another application?&lt;/P&gt;&lt;P&gt;you can find the code works here:&lt;/P&gt;&lt;P&gt;sub dbCreateInsert&lt;/P&gt;&lt;P&gt;dim sConn, oRS, sSQL1,sSQL2,var1&lt;BR /&gt;set var1= ActiveDocument.Variables("VARIABLE")&lt;BR /&gt;var1 = ActiveDocument.Variables("VARIABLE").GetContent().string&lt;BR /&gt;set doc = ActiveDocument&lt;BR /&gt;Set sConn = CreateObject("ADODB.Connection")&lt;BR /&gt;sConn.Open "Provider=OraOLEDB.Oracle.1;Persist Security Info=False;User ID=USERNAME;Password=PASSWORD;Data Source=DBNAME;"&lt;BR /&gt;set oRS =CreateObject("ADODB.Recordset")&lt;/P&gt;&lt;P&gt;'creating table with name gettiing from variable&lt;BR /&gt; sSQL1="CREATE TABLE " &amp;amp; var1 &amp;amp; " (CUSTOMERID varchar(20))"&lt;BR /&gt; set oRS = sConn.execute(sSQL1)&lt;/P&gt;&lt;P&gt;'selecting all different rows&lt;BR /&gt; set cLoRecord=doc.Fields("CUSTOMERID _NO").GetPossibleValues()&lt;BR /&gt; for i=0 to cLoRecord.Count-1&lt;BR /&gt; vRecord = cLoRecord.Item(i).Text&lt;BR /&gt; doc.Fields("CUSTOMERID _NO").Select vRecord&lt;/P&gt;&lt;P&gt;set CM1 = doc.Fields("CUSTOMERID").GetPossibleValues()&lt;BR /&gt; vm1 = cM1.item(0).Text&lt;/P&gt;&lt;P&gt;' writing to db&lt;BR /&gt; sSQL2="INSERT INTO " &amp;amp; var1 &amp;amp; " (CUSTOMERID ) VALUES (" &amp;amp; "'" &amp;amp; vm1 &amp;amp; "')"&lt;BR /&gt; set oRS = sConn.execute(sSQL2)&lt;BR /&gt; next&lt;/P&gt;&lt;P&gt;'warning after writing&lt;BR /&gt;doc.ClearAll&lt;BR /&gt;msgbox("all your selectins has been written")&lt;BR /&gt;set oRS = Nothing&lt;BR /&gt;set sConn = Nothing&lt;/P&gt;&lt;P&gt;end sub&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Nov 2010 15:28:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/performance-problem-about-inserting-qv-selections-to-database/m-p/206572#M62648</guid>
      <dc:creator />
      <dc:date>2010-11-30T15:28:38Z</dc:date>
    </item>
    <item>
      <title>performance problem about inserting qv selections to database via macro</title>
      <link>https://community.qlik.com/t5/QlikView/performance-problem-about-inserting-qv-selections-to-database/m-p/206573#M62649</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Write to Oracle only if cLoRecord.Count &amp;lt; 100 . Otherwise skip writing; reading will be equally slow&lt;/P&gt;&lt;P&gt;-Alex&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Dec 2010 13:08:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/performance-problem-about-inserting-qv-selections-to-database/m-p/206573#M62649</guid>
      <dc:creator />
      <dc:date>2010-12-01T13:08:32Z</dc:date>
    </item>
  </channel>
</rss>

