Re: Insert into table with TEXT column
Posted in 1995
You can't insert blob (BYTE or TEXT) literals into the database via
either INSERT or UPDATE. You can only LOAD the values in, or use blob
variables. Since you appear to be using ESQL/C, using blob variables
shouldn't present too many problems.
You may be able to code around your problem by implicitly inserting null
blobs using the notation:
INSERT INTO SomeTable(Note_ID, Note_Object, Originator_Name, Datetime_Stamp)
VALUES ("...", "...", ...);
Note that the $TABLE notation used in the original will not compile -- or,
at least, it shouldn't.
Yours,
Jonathan Leffler (johnl@informix.com) #include <disclaimer.h>
}From: kathy@mothra.rose.hp.com (Kathy Baughman)
}Date: 26 Jun 1995 22:20:37 GMT
}X-Informix-List-Id: <news.14951>
}
}Was hoping someone out there knows how to deal with doing inserts/updates
}into a table that has one of the columns defined as type `text`. ie:
}
}insert into $TABLE
}values ("...","...",..);
}
}where values is a comma separated list of values to be inserted, in the
}order that the columns appear when you do an 'info columns for $TABLE'. [...]
}
}note_id char(20) no
}note_object char(10) no
}note_text text yes
}originator_name char(20) no
}datetime_stamp datetime year to fraction(5) no
}
}If I try to do an insert for the columns other than the text field, I
}think the insert will fail due to the values being out of sequence.
}Should the text item be the last one defined for the table? How do I manage
}inserts and updates for the text item? Any ideas?