1 Reply Latest reply on Jan 28, 2008 11:25 PM by Mannamal-Oracle

    How insert Clob data

    545538
      Hi,

      I don’t know, how add Clob data?

      DECLARE
      c CLOB:='';
      a SDO_RDF_TRIPLE_S;
      BEGIN
      DBMS_LOB.createtemporary(c,FALSE,DBMS_LOB.session);
      FOR i IN 1..4030 LOOP
      c:= c||'S';
      END LOOP;

      a:= sdo_rdf_triple_s('ab_test11',
      'http://www.example.org/family/John',
      'http://www.example.org/family/fatherOf',
      c);
      INSERT INTO ab_test11 VALUES (a);
      END;

      DECLARE
      c CLOB:='';
      a SDO_RDF_TRIPLE_S;
      BEGIN
      DBMS_LOB.createtemporary(c,FALSE,DBMS_LOB.session);
      FOR i IN 1..4030 LOOP
      c:= c||'S';
      END LOOP;

      a:= sdo_rdf_triple_s('ab_test11',
      'http://www.example.org/family/John',
      'http://www.example.org/family/fatherOf',
      c);
      INSERT INTO ab_test11 VALUES (a);
      END;

      ORA-22835: Buffer too small for CLOB to CHAR or BLOB to RAW conversion (actual: 4032, maximum: 4000)
      ORA-06512: at line 15
        • 1. Re: How insert Clob data
          Mannamal-Oracle
          This should work, and it does - I just tried the exact same code and it works.

          Also using a temporary lob is not necessary - 'c' in your example can just be declared as a CLOB, populated with the string, and inserted into the table.

          I will discuss with you offline to help you figure out your problem.

          Melli