Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2005
    Posts
    92

    Unanswered: Read data from CLOB

    Hello,

    I have a table with a column defined as clob. The data in the clob column is written as, "limit":"10"

    Table:

    ID COLA
    1 (CLOB)

    Data in the COLA: "limit":"10"

    Can someone please suggest me how do I query the the table to output the data from clob column.

    desired output:

    ColA
    10

    Thanks
    Pavan

  2. #2
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    What happened to "limit"?

    Code:
    SQL> create table test (id number, cola clob);
    
    Table created.
    
    SQL> insert into test (id, cola) values (1, '"limit":"10"');
    
    1 row created.
    
    SQL> col cola format a20
    SQL>
    SQL> select * from test;
    
            ID COLA
    ---------- --------------------
             1 "limit":"10"
    
    SQL> select regexp_substr(replace(cola, '"', ''), '\d+$') cola from test;
    
    COLA
    --------------------
    10
    
    SQL>

  3. #3
    Join Date
    Oct 2005
    Posts
    92
    Thanks a lot. Your suggestion worked for me.

    I just have to convert the output now to varchar2.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •