in reply to Retrieve file BLOB from SQL Server 'Image' field type

See Handling BLOB data in ORACLE using perl script, another today's message. Are you colleagues?
لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ
  • Comment on Re: Retrieve file BLOB from SQL Server 'Image' field type

Replies are listed 'Best First'.
Re^2: Retrieve file BLOB from SQL Server 'Image' field type
by porg (Novice) on Sep 23, 2015 at 15:17 UTC

    Hi, thanks for the reply - I read that post before posting this (we are NOT colleagues), and I attempted to integrate his retrieval method using STDOUT, but I still receive the same result. Also it seems his question had a different use-case... Should I always be using STDOUT/fetchrow() for this type of retrieval?

Re^2: Retrieve file BLOB from SQL Server 'Image' field type
by porg (Novice) on Sep 23, 2015 at 17:02 UTC

      Dealing with a general docx file, especially one produced by Word, is difficult because Microsoft don't follow their own specs in all cases. Usually, most specific cases are easier - it's perfectly possible to produce valid, well formatted docx documents using e.g. Template::Toolkit and Archive::Zip, since docx files are just zipped xml at heart.

      I have no knowledge of SQL Server BLOB formats, but it might be worth trying to unzip the .docx file you produce to see if:-

      1. It's a valid zip file.
      2. It contains stuff that looks like xml

      If it doesn't look anything like a zip file, you probably need to do some more processing on the BLOB before writing it to file; if it looks docx-ish, you just have to work out what changes you need to make Word eat it.

        Your recommendation led me to the answer. Thank you for your assistance.