• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1006
  • 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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Introducing Cloud Class® training courses

Tech changes fast. You can learn faster. That’s why we’re bringing professional training courses to Experts Exchange. With a subscription, you can access all the Cloud Class® courses to expand your education, prep for certifications, and get top-notch instructions.

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