Results 1 to 2 of 2

Thread: find empty_clob

  1. #1
    Join Date
    Nov 2003
    Posts
    39

    Unanswered: find empty_clob

    What operator we should use to find out whether the value in CLOB column is an empty_clob
    for example if it is NULL we can use clob_column is NULL
    if there is some value we can say
    clob_column = 'some value'

    But if it is initialized with empty_clob then how to find out ?

    Thanks
    Raj

  2. #2
    Join Date
    Aug 2004
    Location
    France
    Posts
    754
    Code:
    rbaraer@Ora10g> create table test(textfield CLOB);
    
    Table created.
    
    rbaraer@Ora10g> insert into test values (empty_clob());
    
    1 row created.
    
    rbaraer@Ora10g> select count(*) from test where textfield is null;
    
      COUNT(*)
    ----------
             0
    
    rbaraer@Ora10g> select count(*) from test where textfield = empty_clob();
    select count(*) from test where textfield = empty_clob()
                                    *
    ERROR at line 1:
    ORA-00932: inconsistent datatypes: expected - got CLOB
    
    
    rbaraer@Ora10g> select count(*) from test where length(textfield) = 0;
    
      COUNT(*)
    ----------
             1
    
    rbaraer@Ora10g>
    Checking that LENGTH(your_clob_field) = 0 works. I don't know if there is any other way .

    HTH & Regards,

    rbaraer
    ORA-000TK : No bind variable detected... Shared Pool Alert code 5 - Nuclear query ready .

Posting Permissions

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