The CF has a IF condition that will not display an image if the length of the data in IMAGEDATA is 0, so there is something in that column, and it is an image (SQL Developer can display the image - it’s there.)
I’m thinking, more and more, that it’s because I’m just doing “SELECT n.IMAGEDATA FROM NEWSIMAGES n WHERE n.newsID = [id]”. Should I be doing something in the query to indicate that this is binary, not varchar?
In ColdFusion, CFIMAGE can use as the source a FQDN URL, a relative path, a full physical path, or a variable that contains the binary array. The action “writeToBrowser” doesn’t save the data to the hard drive; it does it all in memory, which is cleared as soon as the page is done rendering. Or when GC sweeps through, I’m not sure which.
But, yeah, I thought binary would be passed from the BLOB column in the database; at least, that’s the way MS-SQL does it. But apparently Oracle is a different beast, I guess?
Each database has its ups and downs. You may be right though because according to this article, somehow BLOB in its different forms (TINYBLOB, LARGEBLOB, etc.) do have something in common with strings, even if the defintion itseff is Binary.
My only question about this article is that at one point mentions MySQL so I don’t know if the info is generic for any database made by Oracle or specific for MySQL
Edit: In another article I’ve read that a BLOB field should not have a NULL value. To do so, the field can be created with a default value of EMPTY_BLOB()
The same article explains how to deal with a media file saved in that BLOB field. To do so, it uses UTF_FILE
This is the code posted in the article (I don’t link to it because it is in Spanish)
Sorry that it is an image… but it was posted as an image in the original article.
Thanks, @molona. If I can do that in a query, I’ll give that a shot. If not, I might be screwed as the PTB don’t allow STORED PROC. Although I might be able to convince the DBA to create a function.