How to retrieve blob data size?
Posted by: Michal Kozusznik
Date: September 06, 2006 08:37AM

Hello
I've read documentation, but it suggests to use file_size value stored in database in additional field.

But what about situation when the size is not stored, or wrong value is stored. Then we must find a way to retrieve the size based on blob data read into datareader. But I realy don't know how.

when I do

while (last_size = dr.GetBytes(dr.GetOrdinal(), start, ....)>0)
{
start = start + last_size;
}

.. after the last correct iteration, an exception will be thrown about using data index greater than data size. And of course it is not MySQLException. The documentation says nothing what exception is thrown. However maybe there is some "more frielndly" way to download blob data with unknown file size that supressing exception.

Best regards



Edited 1 time(s). Last edit at 03/10/2007 10:41AM by Michal Kozusznik.

Options: ReplyQuote


Subject
Written By
Posted
How to retrieve blob data size?
September 06, 2006 08:37AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.