• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1002
  • Last Modified:

SELECT query fails when LONG RAW field is empty. How do I compensate for this?

Hi.

I'm having a problem with an ASP page that's making a SQL call to an Oracle DB.  The table contains a column that's LONG RAW and houses images.  I pull records based on an Article Id.  When the Article record contains an image, the select statement I use executes without issue.  If the record has no image, the statement itself fails.  (I've traced it back to the statement.)  However, if I substitute NULL for that field, it works every time.  (Just testing.)

Does anyone know why a simple select statement would fail if a LONG RAW column is empty for a row?  And if so, how do I counter this behavior?

Short version:

SELECT ARTICLE_ID, ARTICLE_IMAGE FROM ARTICLES WHERE ARTICLE_ID = 12345

Again, fails when ARTICLE_IMAGE is empty.

I'm new to Oracle, would really appreciate any help.

Many thanks,

jeristotle
0
jeristotle
Asked:
jeristotle
  • 2
3 Solutions
 
paquicubaCommented:
LONGs and LONG RAWs have been deprecated by Oracle, change the datatype to BLOB and initialize it with an empty_blob.
0
 
jwittenmCommented:
What version of Oracle (release and patchset) are you on?  Are you using Java?
0
 
jwittenmCommented:
Well, in case you check back, and you are on something prior to 8174, some of the Oracle APIs returned something other than NULL when the LONG or LONG RAW columns contained NULL Values prior to 8174.  If this describes your situation, upgrade to the 817 terminal release may resolve it for you.
0
 
jeristotleAuthor Commented:
Thank you both for your feedback.

I'll have to check to see what version is running.  Thanks the help.  I'll post results later.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now