Results 1 to 4 of 4
  1. #1
    Join Date
    Feb 2004
    Posts
    2

    Unanswered: Can i check for empty blob through SQL?

    Hi!
    I have a field in my table that holds a BLOB content. Now i want ot write a query to retrieve all the records that do not have empty BLOBs

    i mean to say, is there any way we can do this using queries..

  2. #2
    Join Date
    Sep 2003
    Location
    The extremely Royal borough of Kensington, London
    Posts
    778
    Select id
    from table
    where BLOB_column IS NULL;
    Bessie Braddock: Winston, you are drunk!
    Churchill: And Madam, you are ugly. And tomorrow, I'll be sober, and you will still be ugly.

  3. #3
    Join Date
    Feb 2004
    Posts
    2

    Can i check for empty blob through SQL?

    But my blob is not NULL. Its empty by default!

    anyway thanks for your help!

  4. #4
    Join Date
    Dec 2003
    Location
    Oklahoma, USA
    Posts
    354
    With BLOB's it is a little different. Empty BLOB's aren't actually NULL, they have a placeholder and do occupy space.

    My guess is that you need the getContentLength() method for the object...

    So your query should be something like:

    SELECT image_name FROM my_images WHERE image_object.getContentLength > 0;

    This will work if your data type for "image_object" is ordsys.ordImage

    Hope this helps!

    JoeB

Posting Permissions

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