Search code examples
oracletypessqlplusclob

How to use Clob datatype in a table for a particular column, which can store limitless characters (paragraph)? As i am beginner in the field


Am using CLOB datatype for a particular column but it cannot store large characters or paragraphs in it.


Solution

  • As code is attached below. This is how I stored a limitless paragraph and printed that at runtime, their code is attached in the second block.

    CREATE TABLE CLOB_TEST
    (
    ID NUMBER,
    TXTPARA CLOB
    );
    INSERT INTO CLOB_TEST(ID, TEXTPARA) VALUES(1, 'gshdhgksghgsdkgsdgjk..');
    

    Usually Clob stores all the characters of paragraphs. However, it shows a single line on runtime, the main issue was to extend the display limit such that to set the maximum width in (bytes) for displaying BLOB, BFILE, CLOB, LONG, NCLOB, and XMLType values, and for copying LONG values. The command is as follows:

    SET LONG 2000000000
    SELECT *FROM CLOBTEST;