Re: text field entry
Posted in 1997
>From: rfrenkel@world.std.com (richard frenkel) >Date: Tue, 28 Jan 1997 06:50:59 GMT >X-Informix-List-Id: <news.33082> > >I have a field defined as text. Doing an insert keeps giving me an error >617 "A blob data type must be supplied". > >The index doesn't mention a blob data type. The section on datatypes >doesn't let on. The section on insert is mute. I'm sure somebody somewhere >knows how to insert text data in a "text" field.... but Informix sure >isn't letting on. I've copied doc@informix.com with this reply so that they can put a cross-reference from Blob to BYTE and TEXT (the two types of blob) somewhere in the index. You aren't giving us much information to work on -- which language are you using to handle the INSERT? There are 5 possibilities which I'll cover; if none of them apply, you'd better get back to c.d.i with a more detailed description of which product, version and platform you are using and what your problem really is. DB-Access, I-SQL (Query-Language Menu): You cannot use INSERT or UPDATE on blob columns, because there is no way to specify a blob-literal (other than NULL), and the way that these products use SQL means that you could only process INSERT and UPDATE statements with literal blobs. I-4GL, NewEra: You need to arrange for the INSERT statement to reference a BYTE or TEXT variable, and you need to have initialized that variable appropriately. This means locating it, typically in a file. If it is in memory, you'll be dropping into ESQL/C or C to set up the value (see next alternative). You also can get the blob data via an editor of some sort (see next but one alternative). ESQL/C: You need to use the header "locator.h" and a structure of type loc_t, and you need to initialize the structure using the instructions in the header file (cryptic) or in an ESQL/C Programmers Manual (cryptic in early versions, expansive in later versions). I-4GL, I-SQL (forms): Using ISQL forms, you can edit blob data quite easily using the editor of your choice. In I4GL, you can enter the data into an initialized BYTE or TEXT blob using the INPUT statement, and then insert it into the database with the INSERT statement. NewEra: You don't have forms in NewEra, but the ixSuperTable should provide mechanisms to supply data for blobs. Yours, Jonathan Leffler (johnl@informix.com) #include <disclaimer.h>