Subject | Re: [firebird-support] question about blob type |
---|---|
Author | Helen Borrie |
Post date | 2004-12-08T21:42:54Z |
At 01:03 PM 8/12/2004 -0700, you wrote:
sub_type 1.
unreferenced value from any SQL operation.
NULL. This is generally unsafe unless you set a default -- and what
default would you set for a non-text blob?
As for the subtype, the engine doesn't know or care what is inside a blob -
you could store a jpeg in a text blob or an html file in a default
blob. Your applications will complain when they get the wrong sort of
data, though.
./hb
>A couple of questions about blob-types.Yes, the default is sub_type 0 so this is what you get if you don't specify
>
>Can I specify a blob as just a "blob"?
sub_type 1.
>Yes: if you want a text blob you have to specify it.
>for example, in a table can I have a field defined as:
>
>....
>blob_field blob not null,
>.....
>
>...or do I have to specify sub_type and other options like so:
>
>.....
>blob_field blob segment sub_type text segment size 1024 not null,
>.....
>It's a column so you have to specify it. You can never return an
>And, when referring to that field in a stored procedure parameter, can I
>just call it a "blob"? For example:
>
>CREATE PROCEDURE sel_prod_by_prod_option_id
>
>(
>
>product_option_id int
>
>)
>
>returns
>
>(
>
>product_id_ int,
>
>product_name_ varchar(50),
>
>product_num_ varchar(50),
>
>synopsis_ varchar(500),
>
>description_ blob,
>
>.................,
>
>...or would I also have to specify all options?
unreferenced value from any SQL operation.
>Probably your exception is coming from defining the blob column as NOT
>I ask because I think my C# code is throwing exceptions (I can find no other
>reason why it wouldn't work) - when I try to insert into a table w/ a blob
>field simply defined as "blob", without sub_type or segment options.
NULL. This is generally unsafe unless you set a default -- and what
default would you set for a non-text blob?
As for the subtype, the engine doesn't know or care what is inside a blob -
you could store a jpeg in a text blob or an html file in a default
blob. Your applications will complain when they get the wrong sort of
data, though.
./hb