Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Reading BLOBS from Oracle into QV11

The proof of concept I am attempting to create has 2 parts

  1. A QV11 app loads a BLOB from Oracle which is a pdf file
  2. The pdf will then be able to be downloaded from the QV app.

Are either of these possible with standard QV functionality?  This qvw will be accessible off of Access Point and the users do have the ability to use the IE Plugin.

-Jake

6 Replies
MarcoWedel

Hi,

maybe using some macro to convert (depending on the format) and store the blob data as pdf file to disk could be a solution.

One example could be:

load script

tabPDF:

LOAD *,

    RecNo() as PDFid,

    len(PDFdata) as LenPDFdata,

    OctetStringToFile(PDFdata, PDFfile) as ResultOctetStringToFile;

LOAD @1 as PDFdata,

    'C:\temp\PDF-File'&RecNo()&'.pdf' as PDFfile

FROM (txt, codepage is 1252, no labels, delimiter is '\t', msq);

VBS module

Function OctetStringToFile(OctetString, FilePath)

  Const adTypeText = 2

  Const adSaveCreateOverWrite = 2

  LenData = Len(OctetString)\2 + Len(OctetString) Mod 2

  set fso = createobject("scripting.filesystemobject")

  set stream = createobject("adodb.stream")

  stream.type = adTypeText

  stream.charset = "windows-1252"

  stream.open

  For i = 0 to LenData-1

  stream.writetext chr(CByte("&h" & Mid(OctetString, i*2+1, 2)))

  Next

  stream.savetofile FilePath, adSaveCreateOverWrite

  stream.close

  OctetStringToFile = "processed"

End Function

QlikCommunity_Thread_179838_Pic1.JPG

QlikCommunity_Thread_179838_Pic2.JPG

QlikCommunity_Thread_179838_Pic3.JPG

QlikCommunity_Thread_179838_Pic4.JPG

hope this helps

regards

Marco

MarcoWedel

You might have to adjust your macro security settings  in the edit module window to be able to execute the vbs function.

Regards

Marco

Not applicable
Author

Marco -

Thanks for your reply.  How confident are you that this solution would work on Access Point (while using IE Plugin)?

-Jake

MarcoWedel

Hi,

I don't see why the application should not work when published to server.

The table/link part is pretty straight forward while the tricky part is done during the script execution.

regards

Marco

Anonymous
Not applicable
Author

Hello Marco

I'm just experiencing a limit of 16k on the "long varbinary" field. So for small files your solution works but for "long varbinary" > 16k I'm loosing data.

Best Regards

Valerio

Not applicable
Author

So I tried the solution and it doesn't work on Access Point with IE Plugin.  The reason why it doesnt work is because the path is relative to the computer you are using.  The file opened fine when using the brower on the server that was hosting Access Point, however when I tried the link from my own pc it said "failed to open".