Results 1 to 4 of 4
  1. #1
    Join Date
    Sep 2008
    Posts
    2

    Unanswered: Inserting CLOB data

    How can i insert data into a field which type is CLOB.

    Thanks,
    Neelesh Vijaivargia.

  2. #2
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    Using the INSERT statement?
    Code:
    SQL> create table test (col clob);
    
    Table created.
    
    SQL> insert into test (col) values
      2  ('This is some text which is being inserted into a CLOB column');
    
    1 row created.
    
    SQL>

  3. #3
    Join Date
    Sep 2008
    Posts
    2
    I have one table which has 4 fields and one of them is CLOB kind if field.

    I want to insert one row into that table but i want to upload multiline of data into CLOB field.I don't know how can i insert any row using insert query which has multiline data.

    Thanks,
    Neelesh Vijai.

  4. #4
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    Quote Originally Posted by MS Windows Notepad test file
    This is a MS Windows Notepad document. I will try to add a few lines of a more or less nonsense text, just to make it span several lines which will then be used as a source in the INSERT statement which is supposed to insert all that text into a CLOB datatype column.
    Oh, by the way, it is Tuesday, 6:45 AM in Croatia. Temperature, where I live, is 5.8 degrees Celsius and - if we may believe meteorologists - it will be a warm Autumn day.
    In the INSERT statement, I will simply copy this text and paste it into the SQL*Plus session.
    OK, let us try it!
    Code:
    SQL> create table test
      2  (id number,
      3   datum date,
      4   text clob
      5  );
    
    Table created.
    
    SQL> insert into test (id, datum, text)
      2  values
      3  (1, sysdate,
      4   'This is a MS Windows Notepad document. I will try to add a few lines of a
     more or less nonsense text, just to make it span several lines which will then
    be used as a source in the INSERT statement which is supposed to insert all that
     text into a CLOB datatype column.
      5  Oh, by the way, it is Tuesday, 6:45 AM in Croatia. Temperature, where I liv
    e, is 5.8 degrees Celsius and - if we may believe meteorologists - it will be a
    warm Autumn day.
      6  In the INSERT statement, I will simply copy this text and paste it into the
     SQL*Plus session.
      7  OK, let us try it!');
    
    1 row created.
    
    SQL> select * from test;
    
            ID DATUM
    ---------- --------
    TEXT
    --------------------------------------------------------------------------------
    
             1 30.09.08
    This is a MS Windows Notepad document. I will try to add a few lines of a more o
    
    
    
    SQL>

Posting Permissions

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