Inconsistent Datatypes [message #395301] |
Wed, 01 April 2009 01:58 |
Maverick27
Messages: 84 Registered: October 2008
|
Member |
|
|
DECODE (dbms_lob.getlength(Photo),0,'No image',Photo)
This DECODE statement gives an error > 'Inconsistent Datatype'
Photo is a BLOB column in the table.
I get the same err with CASE statement.
I want to display the image only if it has been uploaded, else display appropriate message.
Is there a way to overcome this ?
Mave
[Updated on: Wed, 01 April 2009 02:01] Report message to a moderator
|
|
|
|
Re: Inconsistent Datatypes [message #395376 is a reply to message #395304] |
Wed, 01 April 2009 04:37 |
Maverick27
Messages: 84 Registered: October 2008
|
Member |
|
|
Michel Cadot wrote on Wed, 01 April 2009 02:04 | 'No image' and Photo should be of the same type to be used at the same time in DECODE.
If PHOTO is binary type you can't do it in the same way that Photoshop can't display 'No image' string.
Now SQL does not display anything, it jusr return data, it is your application that displays. So return NULL when in your decode and displays NULL as 'No image'.
Regards
Michel
|
Thanks Michel.
Is there no way to display message on report to show if image is not uploaded ??
|
|
|
|
|
|
Re: Inconsistent Datatypes [message #395386 is a reply to message #395381] |
Wed, 01 April 2009 05:05 |
ThomasG
Messages: 3212 Registered: April 2005 Location: Heilbronn, Germany
|
Senior Member |
|
|
Well, you definetely can't "display an image" in SQL.
You can either do an
DECODE (dbms_lob.getlength(Photo),0,'No image','Image')
or an
DECODE (dbms_lob.getlength(Photo),0,SomeDefinedDefaultImageBlob,Photo)
Depending on whether the reporting tool displays image blobs as images or not.
|
|
|
Re: Inconsistent Datatypes [message #395387 is a reply to message #395381] |
Wed, 01 April 2009 05:07 |
|
Michel Cadot
Messages: 68728 Registered: March 2007 Location: Saint-Maur, France, https...
|
Senior Member Account Moderator |
|
|
SQL is an interface from database to program. It is NOT an interface from program (or database) to user.
So it is more a report builder question.
Regards
Michel
|
|
|