Re: TEXT or VARCHAR or what else?
Posted in 1995
Louis C Lam (louislam@iastate.edu) wrote:
: Hi all.
: I am implementing a trouble report mechanism with Informix using a WWW
: interface.
: I need a way to store the history of the trouble reports, Since the
: history can grow fairly large, so I think I should use TEXT or VARCHAR.
: However, with VARCHAR, I cannot put carriage returns. (or can I?)
The bigger problem with VARCHAR is the 255 character limit, which I
assume would be limiting.
: with TEXT, I cannot search or use INSERT.
You could create an interface that scans the TEXT blob and creates a
keyword table that is linked to the TEXT row. This would be a Unix
shell or 'c' solution and not pure 4GL, however.
I don't know what you mean by "us[ing] INSERT". You can LOCATE a BLOB
and then INSERT it into the database, and if you mean insert mode (vs
overstrike) during editing, that would depend on the editor you
choose.
: Any idea?
Another possiblity is an array of CHAR fields, one for each line of the
problem. Your database design changes slightly:
CREATE TABLE trouble_rpt
(trouble_srl SERIAL NOT NULL,...
);
CREATE TABLE trouble_detl
(trouble_srl INTEGER NOT NULL,
trouble_seq SMALLINT NOT NULL, {starts at 1 for each trouble_srl}
trouble_txt CHAR(80)
);
=======================================================================
Dennis J. Pimple dennisp@informix.com Opinions expressed
Senior Consultant -------------------- are mine, and do not
Informix Software Inc Voice: 303-850-0210 necessarily reflect
Denver Colorado USA Fax: 303-779-4025 those of my employer.