RE: Inserting Blobs
Posted in 1997
Chris,
the answer depends on the tool you are using e.g.
- dbaccess/perform: no way to insert/update a blob. At most, you can have a
look at it, and of course you can delete it.
- 4gl: you have to DEFINE a variable of type text or byte, next you have to
use the LOCATE statement to specify where the blob will be stored (in memory,
in a file), third you can go ahead with the insert. Note that due to a number
of limitations in blob variables handling (basically you can't make
assignments to a byte variable, nor can you modify it's contents except with
select statements, can't use blob vars in INPUT statements), you can onlyINSERT blobs taken off a file on disk.
- esql/c: (Not your case, I bet) you have to use a locator structure. A blob
can reside in memory, in a named file, in a opened file or be user programmed.
you can modify a blob (provided that you know its contents type), so in fact
you have almost no limitations.
The general rule however says, you cannot use literal constants whenever
inserting or updating blob columns.
Now to the second point. If you are trying to use a text column to store short
comments, why don't you switch to a varchar?
HTH,
Marco
____________________________________________________________________________
Marco Greco <marcog@ctonline.it> rem radioterapia 39 95 447828 fax 446558
Informix-FAQ http://www.iiug.org 4glWorks http://www.ctonline.it/~marcog
--- On Fri, 23 May 1997 15:35:32 -0400 Chris Stratton <chris@kudzu.com>
wrote:
I have a table that contains a text blob with the blobspace residing in
the table. The blob field on the following example is comments.
How do I insert data to it?
insert into comments (id.topicid,submit_date,comments) values
(1,2,'12/31/97,'Text data to be inserted')
-----------------End of Original Message-----------------