Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

BLOB in DECODE function

782210Mar 25 2012 — edited Mar 26 2012
Hi All,
I am new to sql. I want to use decode for BLOB datatype. For this i written a query like below.
Here user_data is of type BLOB.

select DECODE(length(user_data), 0, null, file_data) user_data from user_table;

I have tried the other way by using case like below. Its worked fine

select
CASE
WHEN LENGTH(user_data )=0
THEN NULL
ELSE user_data
END user_data from user_table;

What i made wrong in the first query?


Thanks
Jimmi
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 23 2012
Added on Mar 25 2012
5 comments
3,191 views