PL/SQL (MOSC)

MOSC Banner

How to use CLOB in decode??

edited Apr 22, 2014 3:46AM in PL/SQL (MOSC) 5 commentsAnswered ✓

I have a very simple table as below:

CREATE TABLE C_POST

(

  POST_ID               INTEGER                 NOT NULL,

  POST_REPLY_SET        CLOB

)

Now I just want to get this field "POST_REPLY_SET" as this format:

If the field "POST_REPLY_SET" is NULL, it should be changed to string "NULL" in my query result.

If the field "POST_REPLY_SET" is not NULL, it should be dbms_lob.substr(post_reply_set).

And based on the string of "POST_REPLY_SET", if it contains change line and return, I need replace change line and return to a space " ".

How to write this SQL? I tried this one:

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center