Re: TEXT datatype?
Posted in 1995
Jim Kistler (kistler@an.hp.com) wrote: : I understand that I can't do a "query" on a TEXT datatype column, but : does this mean I can't test it in any way for an entry? : I'm writing a report for which a TEXT field might be empty and I would : like to note this fact with appropriate logic but can't find any test : on the column that will work with I-SQL. : I can, of course, always print the column and accept a blank entry some : of the time ........can I deal with this in 4GL? As I recall, I was having a problem with testing for NULL blobs: IF r_table.textblob IS NULL was giving me trouble, but I could SELECT textblob INTO r_table.texblob WHERE primarey_key_join AND textblob IS NOT NULL and check for status = NOTFOUND to tell whether or not the blob had been filled in. So I guess if testing IS [NOT] NULL is not working for you (and I'd try this first; I'm talking a couple engine and 4GL versions ago), you could insert the blob into a temp table and then try to fetch it out where NOT NULL and then check status to see if the blob exists or not. Do I get the kludge-of-the-day award? Below is some sample code from an application I worked on while ago, to allowing editing an existing blob for viewing only (no changes saved, and a NULL blob not allowed to be edited. # need to free and reselect the blob FREE mg_errorlog.error_blob LOCATE mg_errorlog.error_blob IN FILE merrortemp SELECT error_blob INTO mg_errorlog.error_blob FROM errorlog WHERE errorlog.errorlog_srl = mg_errorlog.errorlog_srl AND errorlog.error_blob IS NOT NULL ... error checking code removed IF status = NOTFOUND THEN CALL err(8) # No Record LET int_flag = TRUE ELSE LOCATE mg_errorlog.error_blob IN FILE merrortemp END IF IF NOT int_flag THEN LET runtxt = "$DBEDIT ", merrortemp CLIPPED RUN runtxt END IF LET int_flag = FALSE # refill the blob in case they tried to change it FREE mg_errorlog.error_blob LOCATE mg_errorlog.error_blob IN MEMORY ======================================================================= 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.