Home:ALL Converter>NVL function with CLOB datatype

NVL function with CLOB datatype

Ask Time:2021-01-19T19:29:04         Author:Reinaldo Peres

Json Formatter

I have this query:

select LENGTH(NVL(exam.vl_result,' ')) from exam;

And I got this error: ORA-00932: inconsistent datatypes: expected - got CLOB

The column vl_result is CLOB, but I need to use NVL in this case. Is there any way to use NVL with datatype CLOB? If not, what can be the best way to get a similar query.

Author:Reinaldo Peres,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/65790633/nvl-function-with-clob-datatype
Popeye :

Use case..when as follows:\nselect case when exam.vl_result is null then 1 \n else LENGTH(exam.vl_result) \n end \n from exam;\n\nNote: To find the length of clob use dbms_lob.getlength",
2021-01-19T11:33:29
yy