<?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 all records from resident table to SQL db in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Insert-all-records-from-resident-table-to-SQL-db/m-p/1191321#M629071</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Save the table to csv using&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; STORE tablename into filename.csv (txt) ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then import the data into your database. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Qlik is designed to load data from a database not to insert data into a database.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 28 Sep 2016 14:04:46 GMT</pubDate>
    <dc:creator>Colin-Albert</dc:creator>
    <dc:date>2016-09-28T14:04:46Z</dc:date>
    <item>
      <title>Insert all records from resident table to SQL db</title>
      <link>https://community.qlik.com/t5/QlikView/Insert-all-records-from-resident-table-to-SQL-db/m-p/1191320#M629070</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;&lt;/P&gt;&lt;P&gt;Is it possible to insert all records from a resident table into an db table from qlikview script and in 1 shot?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I checked other posts, a loop on the records was suggested (for...next) and an insert statement would be executed every time.&lt;/P&gt;&lt;P&gt;But this method is too heavy and is taking too much time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any alternative to achieve this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Sep 2016 14:01:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Insert-all-records-from-resident-table-to-SQL-db/m-p/1191320#M629070</guid>
      <dc:creator />
      <dc:date>2016-09-28T14:01:54Z</dc:date>
    </item>
    <item>
      <title>Re: Insert all records from resident table to SQL db</title>
      <link>https://community.qlik.com/t5/QlikView/Insert-all-records-from-resident-table-to-SQL-db/m-p/1191321#M629071</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Save the table to csv using&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; STORE tablename into filename.csv (txt) ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then import the data into your database. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Qlik is designed to load data from a database not to insert data into a database.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Sep 2016 14:04:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Insert-all-records-from-resident-table-to-SQL-db/m-p/1191321#M629071</guid>
      <dc:creator>Colin-Albert</dc:creator>
      <dc:date>2016-09-28T14:04:46Z</dc:date>
    </item>
    <item>
      <title>Re: Insert all records from resident table to SQL db</title>
      <link>https://community.qlik.com/t5/QlikView/Insert-all-records-from-resident-table-to-SQL-db/m-p/1191322#M629072</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Is it possible to insert all records from a resident table into an db table from qlikview script and in 1 shot?&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;No. You'll need more shots. One for exporting the table to a csv file and one to import the csv file in your database. Perhaps your dbms supports csv files as virtual tables. That could make it a bit easier.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Sep 2016 14:05:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Insert-all-records-from-resident-table-to-SQL-db/m-p/1191322#M629072</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2016-09-28T14:05:31Z</dc:date>
    </item>
    <item>
      <title>Re: Insert all records from resident table to SQL db</title>
      <link>https://community.qlik.com/t5/QlikView/Insert-all-records-from-resident-table-to-SQL-db/m-p/1191323#M629073</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your quick replies guys &lt;A href="https://community.qlik.com/qlik-users/96544"&gt;gwassenaar&lt;/A&gt;‌ &lt;A href="https://community.qlik.com/qlik-users/4118"&gt;colin_albert&lt;/A&gt;‌&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I c, based on your answers, I'm also checking how we could automate the import of the csv doc...&lt;/P&gt;&lt;P&gt;Any suggestion ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I searched a bit and found about the bulk insert command.&lt;/P&gt;&lt;P&gt;The client will be testing it through qlikview script (to automate the process store csv + write back to db).&lt;/P&gt;&lt;P&gt;Fingers crossed &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/wink.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But what do you think? Theoretically it should work, no ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Sep 2016 14:51:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Insert-all-records-from-resident-table-to-SQL-db/m-p/1191323#M629073</guid>
      <dc:creator />
      <dc:date>2016-09-28T14:51:23Z</dc:date>
    </item>
    <item>
      <title>Re: Insert all records from resident table to SQL db</title>
      <link>https://community.qlik.com/t5/QlikView/Insert-all-records-from-resident-table-to-SQL-db/m-p/1191324#M629074</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I had the same problem, but with by making a string of the variables and inserting 1000 rows at a time, decreasing the load time exponentaily. Due to some of the values in the fields I hade to swith between ' for delimiter and Chr(39). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;populateObj:&lt;/P&gt;&lt;P&gt;LOAD [client_id],&lt;/P&gt;&lt;P&gt;&amp;nbsp; [obj_id],&lt;/P&gt;&lt;P&gt;&amp;nbsp; [objval_id],&lt;/P&gt;&lt;P&gt;&amp;nbsp; [descr],&lt;/P&gt;&lt;P&gt;&amp;nbsp; [valid_from_isodate],&lt;/P&gt;&lt;P&gt;&amp;nbsp; [valid_to_isodate],&lt;/P&gt;&lt;P&gt;&amp;nbsp; [active],&lt;/P&gt;&lt;P&gt;&amp;nbsp; [created],&lt;/P&gt;&lt;P&gt;&amp;nbsp; [row_id],&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; '('&amp;amp;if(isnull([client_id]),'NULL',[client_id]) &amp;amp;', '&amp;amp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; if(isnull([obj_id]), 'NULL',chr(39)&amp;amp;[obj_id]&amp;amp;chr(39)) &amp;amp;', '&amp;amp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; if(isnull([objval_id]),'NULL',chr(39)&amp;amp;[objval_id]&amp;amp;chr(39)) &amp;amp;', '&amp;amp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; if(isnull([descr]), 'NULL',chr(39)&amp;amp;[descr]&amp;amp;chr(39))&amp;amp;', '&amp;amp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; if(isnull([valid_from_isodate]), 'NULL',chr(39)&amp;amp;[valid_from_isodate]&amp;amp;chr(39)) &amp;amp;', '&amp;amp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; if(isnull([valid_to_isodate]), 'NULL',chr(39)&amp;amp;[valid_to_isodate]&amp;amp;chr(39))&amp;amp;', '&amp;amp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; if(isnull([active]),'NULL',[active])&amp;amp;', '&amp;amp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; if(isnull([created]),'NULL', chr(39)&amp;amp;[created]&amp;amp;chr(39))&amp;amp;', '&amp;amp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; if(isnull([row_id]),'NULL', [row_id])&amp;amp;')' as SQL_queryRowString,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; RowNo() as RowNo,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Round(RowNo()-500,1000) as RowNo1000&lt;/P&gt;&lt;P&gt;FROM [lib://xxxxxx (xxxx)/xxxxxx.qvd]&lt;/P&gt;&lt;P&gt;(qvd);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NoConcatenate&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;tempTable:&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;RowNo1000,&lt;/P&gt;&lt;P&gt;Concat(SQL_queryRowString, ',') as SQLQueryValues1000&lt;/P&gt;&lt;P&gt;Resident populateObj&lt;/P&gt;&lt;P&gt;Group by RowNo1000;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Drop table populateObj;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LIB CONNECT TO 'BizView (ghh_qliktech)';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SQL DELETE FROM "bxxxxxxx".xxxxxxx;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For vRowNo = 1 to NoOfRows('tempTable')&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt; Let vSQLInsertValues = Peek('SQLQueryValues1000',vRowNo-1,'tempTable');&lt;/P&gt;&lt;P&gt; LET vInsertedRows = vRowNo * 1000;//Used to see the loop progress&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp; SQL INSERT INTO "xxxxxx".xxxxxxxx ( &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; client_id, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; obj_id,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; objval_id,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; descr,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; valid_from_isodate,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; valid_to_isodate,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; active,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; created,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; row_id &lt;/P&gt;&lt;P&gt;&amp;nbsp; ) VALUES&lt;/P&gt;&lt;P&gt;&amp;nbsp; $(vSQLInsertValues);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; TRACE Inserting $(vInsertedRows) rows; &lt;SPAN style="font-size: 13.3333px;"&gt;//Used to see the loop progress&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;Next vRowNo&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Drop Table tempTable;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it helps! &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Nov 2016 15:23:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Insert-all-records-from-resident-table-to-SQL-db/m-p/1191324#M629074</guid>
      <dc:creator />
      <dc:date>2016-11-22T15:23:03Z</dc:date>
    </item>
    <item>
      <title>Re: Insert all records from resident table to SQL db</title>
      <link>https://community.qlik.com/t5/QlikView/Insert-all-records-from-resident-table-to-SQL-db/m-p/1191325#M629075</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Salut Jean Pierre,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As Gysbert put it, the answer is "no", there is no one shot. However, check this thread: &lt;A href="https://community.qlik.com/docs/DOC-19777"&gt;Using QlikView for (bulk) INSERT into SQL&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I created a script that does bulk inserts in series of 1,000 rows per dump. Hence, say for a table/QVD of 12,345 rows, the script will do 12 dumps of 1,000 each and then a dump of the last 345 rows. I think a number of individuals have also thought about this, such as David G.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Since this script is based on using a QVD at source, I am sure you can re-use the latter part to write from a RESIDENT table, the process is the same. You would have to be cautious in your 'data types' and what it is in the source table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My script was build in order for the script to first build the SQL table and then load the data into it, which would ensure the 2 are consistent and won't produce errors.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Video for this on YouTube: &lt;A href="https://www.youtube.com/watch?v=47Nx94O2anE" title="https://www.youtube.com/watch?v=47Nx94O2anE"&gt;Qlik Bulk INSERT into SQL table - YouTube&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kr,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheenu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 11 Mar 2018 16:57:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Insert-all-records-from-resident-table-to-SQL-db/m-p/1191325#M629075</guid>
      <dc:creator>cheenu_janakira</dc:creator>
      <dc:date>2018-03-11T16:57:03Z</dc:date>
    </item>
  </channel>
</rss>

