Home » SQL & PL/SQL » SQL & PL/SQL » How To Check Images with Zero Bytes in Size on BLOB column datatype (Oracle 11.2.0.3.0)
How To Check Images with Zero Bytes in Size on BLOB column datatype [message #638563] Mon, 15 June 2015 08:04 Go to next message
wtolentino
Messages: 398
Registered: March 2005
Senior Member
we have this table that has a column blob datatype. the values that we stored in the column is images mostly in .tiff format. they are data feeds coming from another agency that we store for our applications. the problem is some of them are zero bytes. is there a way to check their size? we need to determine which rows has a images that has zero bytes so we can correct them. thanks.
Re: How To Check Images with Zero Bytes in Size on BLOB column datatype [message #638565 is a reply to message #638563] Mon, 15 June 2015 08:12 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
is GOOGLE broken for you?

https://www.google.com/webhp?hl=en&tab=ww#hl=en&q=oracle+blob+length
Re: How To Check Images with Zero Bytes in Size on BLOB column datatype [message #638566 is a reply to message #638563] Mon, 15 June 2015 08:13 Go to previous messageGo to next message
cookiemonster
Messages: 13920
Registered: September 2008
Location: Rainy Manchester
Senior Member
Wouldn't the blob column be null in that case?
Re: How To Check Images with Zero Bytes in Size on BLOB column datatype [message #638569 is a reply to message #638566] Mon, 15 June 2015 08:41 Go to previous messageGo to next message
wtolentino
Messages: 398
Registered: March 2005
Senior Member
thank you. it is not null we determine it as zero bytes by opening the blob and saving it as a file. when we checked the file has zero bytes.
Re: How To Check Images with Zero Bytes in Size on BLOB column datatype [message #638570 is a reply to message #638569] Mon, 15 June 2015 08:46 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
wtolentino wrote on Mon, 15 June 2015 06:41
thank you. it is not null we determine it as zero bytes by opening the blob and saving it as a file. when we checked the file has zero bytes.



what is specific difference between zero length & NULL?
How do you programatically differentiate between these two cases?
Re: How To Check Images with Zero Bytes in Size on BLOB column datatype [message #638576 is a reply to message #638570] Mon, 15 June 2015 09:08 Go to previous messageGo to next message
cookiemonster
Messages: 13920
Registered: September 2008
Location: Rainy Manchester
Senior Member
So use dbms_lob.getlength to check is the length is 0.
Re: How To Check Images with Zero Bytes in Size on BLOB column datatype [message #638578 is a reply to message #638570] Mon, 15 June 2015 09:11 Go to previous messageGo to next message
Michel Cadot
Messages: 68645
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

http://www.orafaq.com/forum/mv/msg/195213/627385/#msg_627385

Re: How To Check Images with Zero Bytes in Size on BLOB column datatype [message #638579 is a reply to message #638570] Mon, 15 June 2015 09:17 Go to previous messageGo to next message
wtolentino
Messages: 398
Registered: March 2005
Senior Member
as of now we do not have codes to programmatically differentiate a null file and zero byte file. the issue is that when we open the image on our apps there was nothing on it. when we download it there is a file however the size is zero.

for example:
R:\>dir 2*.tiff
 Volume in drive R is dot_home
 Volume Serial Number is 009A-9A03

 Directory of R:\

06/15/2015  10:15 AM                 0 21352455.tiff
               1 File(s)              0 bytes
               0 Dir(s)  45,057,359,380,480 bytes free

R:\>
Re: How To Check Images with Zero Bytes in Size on BLOB column datatype [message #638580 is a reply to message #638576] Mon, 15 June 2015 09:19 Go to previous messageGo to next message
cookiemonster
Messages: 13920
Registered: September 2008
Location: Rainy Manchester
Senior Member
cookiemonster wrote on Mon, 15 June 2015 15:08
So use dbms_lob.getlength to check is the length is 0.

Re: How To Check Images with Zero Bytes in Size on BLOB column datatype [message #638642 is a reply to message #638580] Tue, 16 June 2015 07:20 Go to previous message
wtolentino
Messages: 398
Registered: March 2005
Senior Member
thank you all.
Previous Topic: Sysdate with time interval parameter
Next Topic: Create VIEW retrieving from dynamically configured table/queries
Goto Forum:
  


Current Time: Wed Apr 24 13:44:14 CDT 2024