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

Thread: How to put the LONG data in Condition

  1. #1
    Join Date
    Apr 2003
    Location
    Hyderabad
    Posts
    40

    How to put the LONG data in Condition

    Hai,
    I have to Put the condition on LONG data.
    Condition is like tstlong(filed Name) <> 'TEST';

    Thanks & Regards
    Bala Krishna.Ravi

  2. #2
    Join Date
    Jun 2005
    Location
    London, UK
    Posts
    159
    LONG is obsolete and provided for compatibility with earlier releases. Can you use a CLOB instead? (Note that although you can change a LONG to a CLOB with ALTER TABLE, you cannot change back.)

  3. #3
    Join Date
    Sep 2000
    Location
    Sao Paulo,SP,Brazil, Earth, Milky Way
    Posts
    350
    Raavi, ** IF ** you canĀ“t change to LOBs right now, and ** IF ** your longs are smaller than 32 Kb, you can write something like :

    reate or replace procedure longsubstr( p_rowid in rowid,
    p_from in number,
    p_for in number )
    return varchar2
    as
    l_tmp long;
    begin
    select LONG_COLUMN into l_tmp from T where rowid = p_rowid;

    return substr( l_tmp , p_from, p_for );
    end;
    /


    ==> and then you can:

    select a, b, longsubstr(rowid,35,200) from TABLEwithLONGs
    /


    if your LONGs are grather than 32 Kb, the procedure will be more complicated, you will need to "break" the LONG in pieces with DBMS_SQL, but it is possible.

    []s

    Chiappa

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