Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 2006
    Posts
    20

    Unanswered: Convert LONG to CLOB in a PL/SQL

    I would like to know if there is possible to trasnforma a CLOB type variable intro a long type variable
    I know, that LONG is obsolete in Oracle, but I need it, because in a PL/SQL 'execute immediate' sentence
    a CLOB is not allowed.
    I'm working in Oracle 9i.

    Any help will be greatly apreciatted.

  2. #2
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

  3. #3
    Join Date
    Apr 2003
    Location
    Greenville, SC (USA)
    Posts
    1,155
    Here's an part of a proc that I user - note... dynamic sql pulling in table and column names ... lobloc is a clob datatype


    lobloc := empty_clob();
    -- Get row for update and rewrite clob value ---
    STMT2 := 'SELECT '||c_column_updated||'
    FROM '||c_table_name||'
    WHERE '||c_key_columns;
    EXECUTE IMMEDIATE STMT2 INTO LOBLOC;

    amount := SYS.DBMS_LOB.GETLENGTH(lobloc);
    if amount > 0
    then
    if amount > 2000
    then
    amount := 2000;
    end if;
    dbms_lob.read(lobloc,amount,1,v_bits);
    end if;

    STMT1 := 'update '||v_table_name||'
    set '||c_column_updated||' = '||''''||sys.utl_raw.cast_to_raw(v_bits)||''''||'
    WHERE '||c_key_columns;

    EXECUTE IMMEDIATE STMT1;

Posting Permissions

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