Skip to main content

How to store binary image (BLOB) SQL server and load it into QlikView

No ratings
cancel
Showing results for 
Search instead for 
Did you mean: 
ToniKautto
Employee
Employee

How to store binary image (BLOB) SQL server and load it into QlikView

Last Update:

May 11, 2021 3:20:29 PM

Updated By:

Andre_Sostizzo

Created date:

Dec 4, 2013 7:01:08 AM

Attachments
Storing an image as binary data in an SQL Server and then loading it into QlikView can be done as described in the steps below.
 

Environment:

 

  1. Create a table to contain the image as a varbinary or image 

    CREATE TABLE ImageAsVarBinary 

       ID int IDENTITY(1,1), 
       ImageName varChar(50), 
       varBinaryData varBinary(MAX) 
    );

     
  2. Load an image file to the table 

    INSERT INTO ImageAsVarBinary (ImageName, varBinaryData) 
    SELECT 'image1', BulkColumn FROM OPENROWSET (Bulk 'C:\Test.jpg', SINGLE_BLOB) AS varBinaryData;

     
  3. Load the image to QVW by using an info load 

    INFO SQL SELECT
    ImageName, 
    varBinaryData 
    FROM "DB_TABLE_NAME".dbo.ImageAsVarBinary;

     
  4. Show the image in an object by setting the field value to
     
    =INFO(ImageName)
     
  5. Set the field/object Representation to Image


NOTE: 

  • The syntax and SQL example above are based on Microsoft SQL Server 2008, but the principle should be the same on most SQL based database servers.
  • For an example of fetching BLOB image from Oracle to QlikView, please refer to the community post at https://community.qlik.com/thread/141239
  • See the attached qvw document for a demonstration
Labels (2)
Contributors
Version history
Last update:
‎2021-05-11 03:20 PM
Updated by: