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

Posted on 2005-05-02
Last Modified: 2012-05-05

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:


Again, fails when ARTICLE_IMAGE is empty.

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

Many thanks,

Question by:jeristotle
    LVL 23

    Assisted Solution

    LONGs and LONG RAWs have been deprecated by Oracle, change the datatype to BLOB and initialize it with an empty_blob.
    LVL 6

    Assisted Solution

    What version of Oracle (release and patchset) are you on?  Are you using Java?
    LVL 6

    Accepted Solution

    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.

    Author Comment

    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.

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Join & Write a Comment

    How to Unravel a Tricky Query Introduction If you browse through the Oracle zones or any of the other database-related zones you'll come across some complicated solutions and sometimes you'll just have to wonder how anyone came up with them.  …
    This post first appeared at Oracleinaction  ( Anju Garg (Myself). I  will demonstrate that undo for DML’s is stored both in undo tablespace and online redo logs. Then, we will analyze the reaso…
    This video explains at a high level with the mandatory Oracle Memory processes are as well as touching on some of the more common optional ones.
    This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function

    734 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    24 Experts available now in Live!

    Get 1:1 Help Now