Re: Fwd: inserting blobs
Posted in 2009
On Tue, Sep 22, 2009 at 12:50, Floyd Wellershaus <floyd@fwellers.com> wrote:
> Thanks.
> 2 questions.
> -- how do I decide whether a pdf file is a simple blob or not ?
>
You get to choose. You could treat it as a BYTE blob or as a BLOB blob;
both work.
If you use BLOB, you will need a smart blob space and you will use a PUT
clause to locate the blob data into the blob space. If you use BYTE, you
can either store the data IN TABLE or place it in a blob space - possibly
with a page size different from the default page size. You specify the IN
<blobspace> clause along with the column definition.
What are you going to do with the blob once it is in the database? If, as I
suspect, the answer is 'read it back into a file, occasionally', then you
might be better off with a smart blob (BLOB); you can use LOTOFILE() and
FILETOBLOB() to get the data where you want rather easily.
> -- if the table is already created, can I alter the storage parameter to
> use the 'put clause'
Yes, I think so.
ALTER TABLE blob_tablename PUT blob_column IN (blobspace);
I've not tested that, but it's what I read from the manual.
> *----- Original Message -----*
> *From:* "Art Kagel" <art.kagel@gmail.com>
> *Sent:* Tue, September 22, 2009 15:18
> *Subject:* Fwd: inserting blobs
>
>
> For a simple large object (types BYTE and TEXT) you deffine the blobspace
> into which to place the BLOB column in the column's definition line:
>
> ... some_text TEXT in my_blobspace, ...
> For smart blob columns you use a PUT clause after the EXTENT clause:
>
> ... some_slob_col CLOB, ...
> ) IN somedbspace PUT (some_slob_col) in mysmartblobspace...;
>
> For smart blobs, if you leave off the PUT clause the engine will distribute
> the values in the existing smart blobspaces. For simple blobs, you either
> have to specify 'IN TABLE' or 'IN some_blobspace'
>
> Art
>
> Art S. Kagel
> Oninit (www.oninit.com)
> IIUG Board of Directors (art@iiug.org)
>
> Disclaimer: Please keep in mind that my own opinions are my own opinions
> and do not reflect on my employer, Oninit, the IIUG, nor any other
> organization with which I am associated either explicitly or implicitly.
> Neither do those opinions reflect those of other individuals affiliated
> with any entity with which I am affiliated nor those of the entities
> themselves.
>
>
>
> On Tue, Sep 22, 2009 at 1:20 PM, Floyd Wellershaus <floyd@fwellers.com>wrote:
>
>> Our developers want to insert pdf files into the ids10.0.fc5 database now.
>> It will be stored as a row in a table where the other fields are not blob
>> types.
>> I am going to make a blob dbspace or an sbspace.
>> Do I need to do something with the table storage parameters to make the
>> blob go there, or does Informix just know that anything you try to insert
>> into a blob datatype row, will automatically get stored into the blob space
>> ?
>>
>> Thanks,
>> floyd
>>
>>
>> _______________________________________________
>> Informix-list mailing list
>> Informix-list@iiug.org
>> http://www.iiug.org/mailman/listinfo/informix-list
>>
>>
>
> ------------------------------
>
> _______________________________________________
> Informix-list mailing list
> Informix-list@iiug.org
> http://www.iiug.org/mailman/listinfo/informix-list
>
>
> _______________________________________________
> Informix-list mailing list
> Informix-list@iiug.org
> http://www.iiug.org/mailman/listinfo/informix-list
>
>
--
Jonathan Leffler #include <disclaimer.h>
Email: jleffler@earthlink.net, jleffler@us.ibm.com
Guardian of DBD::Informix v2008.0513 -- http://dbi.perl.org/
"Blessed are we who can laugh at ourselves, for we shall never cease to be
amused."
NB: Please do not use this email for correspondence.
I don't necessarily read it every week, even.
Jonathan Swift<http://www.brainyquote.com/quotes/authors/j/jonathan_swift.html>
- "May you live every day of your life."