<?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 How to store images into SQL database and load them? in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/How-to-store-images-into-SQL-database-and-load-them/m-p/558071#M208313</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I know how to load images by paths of them into QV, but how can I store images into this table and load them into QV?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I created a table with an image type field in the SQL database, but I don't know how to use this field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CREATE TABLE [dbo].[ImageLibrary](&lt;/P&gt;&lt;P&gt; [IMG_Name] [nvarchar](50)&amp;nbsp; &lt;/P&gt;&lt;P&gt;,[IMG] [&lt;SPAN style="color: #ff0000;"&gt;image&lt;/SPAN&gt;] NULL&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 24 Sep 2013 05:47:49 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2013-09-24T05:47:49Z</dc:date>
    <item>
      <title>How to store images into SQL database and load them?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-store-images-into-SQL-database-and-load-them/m-p/558071#M208313</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I know how to load images by paths of them into QV, but how can I store images into this table and load them into QV?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I created a table with an image type field in the SQL database, but I don't know how to use this field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CREATE TABLE [dbo].[ImageLibrary](&lt;/P&gt;&lt;P&gt; [IMG_Name] [nvarchar](50)&amp;nbsp; &lt;/P&gt;&lt;P&gt;,[IMG] [&lt;SPAN style="color: #ff0000;"&gt;image&lt;/SPAN&gt;] NULL&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Sep 2013 05:47:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-store-images-into-SQL-database-and-load-them/m-p/558071#M208313</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-09-24T05:47:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to store images into SQL database and load them?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-store-images-into-SQL-database-and-load-them/m-p/558072#M208314</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi John,&lt;/P&gt;&lt;P&gt;I'm working on this same issue myself.&amp;nbsp; I have however cracked the first step to storing the images in to a database by creating an App.&lt;/P&gt;&lt;P&gt;If you have Visual Studio you can follow the instructions via this youtube video: &lt;A href="https://youtu.be/BqyAAGMfTD8" title="https://youtu.be/BqyAAGMfTD8"&gt;Insert Image to SQL Server and Retrieve Image from SQL Server - YouTube&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Another method if you have direct access to the host server machine is to use OpenRowSet Bulk import;&lt;/P&gt;&lt;P&gt;&lt;CODE style="font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, sans-serif;"&gt;&lt;SPAN class="kwd" style="color: #101094;"&gt;&lt;EM&gt;insert&lt;/EM&gt;&lt;/SPAN&gt;&lt;EM&gt;&lt;SPAN class="pln" style="color: #303336;"&gt; &lt;/SPAN&gt;&lt;SPAN class="kwd" style="color: #101094;"&gt;into&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #303336;"&gt; tableName &lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #303336;"&gt;(&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #303336;"&gt;ImageColumn&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #303336;"&gt;)&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #303336;"&gt; &lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN class="kwd" style="color: #101094;"&gt;SELECT&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #303336;"&gt; BulkColumn &lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN class="kwd" style="color: #101094;"&gt;FROM&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #303336;"&gt; &lt;/SPAN&gt;&lt;SPAN class="kwd" style="color: #101094;"&gt;Openrowset&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #303336;"&gt;(&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #303336;"&gt; &lt;/SPAN&gt;&lt;SPAN class="kwd" style="color: #101094;"&gt;Bulk&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #303336;"&gt; &lt;/SPAN&gt;&lt;SPAN class="str" style="color: #7d2727;"&gt;'image..Path..here'&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #303336;"&gt;,&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #303336;"&gt; Single_Blob&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #303336;"&gt;)&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #303336;"&gt; &lt;/SPAN&gt;&lt;SPAN class="kwd" style="color: #101094;"&gt;as&lt;/SPAN&gt;&lt;/EM&gt;&lt;SPAN class="pln" style="color: #303336;"&gt;&lt;EM&gt; img&lt;/EM&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="pln" style="color: #303336;"&gt;&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="pln" style="color: #303336;"&gt;Note, however that the image location must be on the same server host machine. A network location will not work unless mapped from the host server. (hence you need permission on actual SQL Server host machine.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="pln" style="color: #303336;"&gt;&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;Ok I solved the import to Qlikview bit with the help of another post: &lt;A href="https://community.qlik.com/message/216287"&gt;GET A BLOB INTO YOUR QV SUCCESFULLY!&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="pln" style="color: #303336;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="pln" style="color: #303336;"&gt;This is the script I used;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;SPAN class="pln" style="color: #303336;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;EM&gt;ODBC CONNECT TO [YourDatabaseName];&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;EM&gt;Images:&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;EM&gt;LOAD ImageId,&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SiteReference as SiteRef_2,&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ImageName,&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ImageType,&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ImageFile;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;EM&gt;SQL SELECT *&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;EM&gt;FROM [YourDatabaseTableName];&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;EM&gt;INFO &lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;EM&gt;SELECT ImageId, ImageFile&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;EM&gt;FROM [&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;EM style="font-size: 8pt;"&gt;YourDatabaseTableName]&lt;/EM&gt;&lt;/SPAN&gt;;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;The first section of script is a normal load of the whole image holding table so I can bring in other data fields.&amp;nbsp; Also SiteRef_2 is used to link to another table elsewhere in qlikview.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;The second section of the actual image load.&amp;nbsp; Use Info and just 2 fields with the second field being the BLOB, the 1st field I'll refer to as &lt;SPAN style="font-size: 13.3333px;"&gt;the Image reference field below.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Next is how to use and reference the image file (which stumped me for a bit) In any Edit Expression screen select the Images Tab at the bottom and then change the Image Folder, where you should now find the Image reference field (in my case ImageId).&amp;nbsp; You can now paste in any of your database images. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;The actual expression to refer to an image is 'qmem://[ImageReferenceField Name]/[ImageReferenceField relating to image to show]'&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;So as an example if I wanted to show ImageFile with ImageId 1 the expression would be 'qmem://ImageId/1' this can be made dynamic by using ='qmem://ImageId/'&amp;amp;[ImageId] in a Text Object and then selecting any of the linked fields such as Image name or type from a List box.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Feb 2017 15:24:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-store-images-into-SQL-database-and-load-them/m-p/558072#M208314</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-02-16T15:24:22Z</dc:date>
    </item>
  </channel>
</rss>

