DBAsupport.com Forums - Powered by vBulletin
Results 1 to 2 of 2

Thread: Max length of a Long column

  1. #1
    Join Date
    May 2001
    Location
    Atlanta US
    Posts
    262

    Max length of a Long column

    Hi Gurus,

    Is there any way I can find the maximum length of a LONG column?

    Thanks!
    Hemant

  2. #2
    Join Date
    May 2001
    Location
    Atlanta US
    Posts
    262
    Found the answer in the forum itself...

    This was posted by ssmith. Thanks ssmith!

    create or replace procedure find_long_length is

    CURSOR a1 is
    SELECT col_name
    FROM table_name;

    vRaw number;
    v_max_len number;

    BEGIN
    vRaw :=0;
    v_max_len := 0;

    FOR arec in a1 LOOP

    vRaw := utl_raw.length(arec.col_name);

    if vRaw > v_max_len then
    v_max_len := vRaw;
    end if;

    END LOOP;
    dbms_output.put_line('Max Length is '||v_max_len);
    END;
    Hemant

Posting Permissions

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


Click Here to Expand Forum to Full Width