Subject | Re: [Firebird-Java] BLOBs |
---|---|
Author | unordained |
Post date | 2010-07-29T15:08:16Z |
---------- Original Message -----------
From: "Steffen Heil" <lists@...>
I'm no authority, but in general, Firebird only sends back blob id's during
primary select, and then fetches each blob you request individually. So
conditionally requesting it should do what you want.
As to the other question, I don't know. If nothing else, can you return an extra
field?
select ... , case when my_blob is null then 0 else 1 end as have_blob ...
-Philip
From: "Steffen Heil" <lists@...>
> 2) I need to load some blobs of a big table, but not all. Whether I------- End of Original Message -------
> want to read a certain block depends on other values in the same row.
> Can I just do something like this: select value1, value2, blob from ....
> and
> if ( resultSet.getInt( "value1" ) == 3 )
> return resultSet.getBytes( "blob" );
>
> Now I am a little concerned that this results in fetching all blobs
> from the server. Is this correct? Or are only the those blobs fetched
> that I actually get() ? Or do I have to select only the other values
> and then open another statement especially for the blobs I am
> interested in?
I'm no authority, but in general, Firebird only sends back blob id's during
primary select, and then fetches each blob you request individually. So
conditionally requesting it should do what you want.
As to the other question, I don't know. If nothing else, can you return an extra
field?
select ... , case when my_blob is null then 0 else 1 end as have_blob ...
-Philip