Results 1 to 6 of 6
  1. #1
    Join Date
    Apr 2002
    Location
    Columbia, TN
    Posts
    1

    Post Unanswered: Inserting CLOBS from SQL statements

    Can anyone point me to a code example of how to insert more than 4000 characters into a CLOB field in Oracle 8.1.6 using SQL statements?

    I have a Cold Fusion page that takes input from a form to post to a database. If the "body" field is more than 4000 characters, the page returns the following error:

    Oracle Error Code = 1704
    ORA-01704: string literal too long

    The code I'm using is just a simple INSERT into as follows

    <cfquery datasource="#request.aspectdatabase#">
    Insert into
    CUSTOMER_STORIES(
    ...
    CLBODY,
    ...
    )
    Values(
    ...
    '#form.clBody#',
    ...
    )

    </cfquery>

    Thanks in advance for any help.

  2. #2
    Join Date
    Apr 2002
    Location
    California, USA
    Posts
    482

    Cool

    Look no further than:

    http://www.dbaclick.com/cgi-bin/ib3/...bd2e657cfbffff;act=ST;f=15;t=89

    Check the latest Oracle DBA forums for more information:

    http://www.dbaclick.com/cgi-bin/ib3/ikonboard.cgi


    Hope that helps,

    Trifon Anguelov
    Senior Oracle DBA

    http://www.dbaclick.com

  3. #3
    Join Date
    Mar 2002
    Posts
    4
    Originally posted by clio_usa
    Look no further than:

    http://www.dbaclick.com/cgi-bin/ib3/...bd2e657cfbffff;act=ST;f=15;t=89

    Check the latest Oracle DBA forums for more information:

    http://www.dbaclick.com/cgi-bin/ib3/ikonboard.cgi


    Hope that helps,

    Trifon Anguelov
    Senior Oracle DBA

    http://www.dbaclick.com
    Why would he go to that forum? It's rubbish compared to this IMVHO?

  4. #4
    Join Date
    Apr 2002
    Location
    California, USA
    Posts
    482
    Why do not you answer the user's question and let the the PEOPLE decide which one is better?????

    STALIN !!!!!

    Show how do you know ORACLE !!!

  5. #5
    Join Date
    Apr 2002
    Posts
    6
    Hope this code solves ur problem

    create table temp (key number, clob_col CLOB);
    insert into temp values (10, empty_clob());

    declare
    lob_loc CLOB;
    amt binary_integer;
    pos integer := 1;
    v_clob varchar2(32000);
    begin
    for i in 1..12000 loop
    v_clob := v_clob || 'a';
    end loop;
    insert into temp values (20, empty_clob());
    amt := LENGTH(v_clob);
    select clob_col into lob_loc from temp where key=20;
    DBMS_LOB.WRITE(lob_loc, amt, pos, v_clob);
    dbms_output.put_line('Inserted');
    end;
    /

  6. #6
    Join Date
    Apr 2002
    Location
    beijing,china
    Posts
    20
    working with LOB is a tough work, no mater what language you use,
    such as java,oci,proc,prosql, you need use a special way, in ORACLE_HOME, there is a lots demos , you can find it .

Posting Permissions

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