Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2002
    Posts
    42

    Unanswered: Need to see if a BLOB field is empty.

    I have a table with a file name, file size, and the file data. The file data is stored in a BLOB. I need to find rows where the there is no file data in the field. I have tried:

    select fileName
    ,fileSize
    from fileTable
    where fileData IS NULL

    but this does not see to work. Is there a better way?

    Oracle 8i
    Suse Linux 7.2

    - Thanks...

  2. #2
    Join Date
    Dec 2002
    Location
    Netherlands
    Posts
    118

    Use DBMS_LOB

    Hi

    This example works for me:



    [REMIVISSER@DB4.ORA-0000.COM] create table demo(k number, l blob);

    Table created.

    [REMIVISSER@DB4.ORA-0000.COM] insert into demo values( 1, NULL);

    1 row created.

    [REMIVISSER@DB4.ORA-0000.COM] commit;

    Commit complete.

    [REMIVISSER@DB4.ORA-0000.COM] select k from demo where dbms_lob.getlength(l) IS NULL;

    K
    ----------
    1


    Good luck!!

    Remi
    Remi Visser

    Oracle Database Administrator
    (OCP certified 8i)

    Homepage: http://home.remidian.com/

Posting Permissions

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