Re: Was Problem 7.20 (Data type change)
Posted in 1997
>From: 75176.2330@compuserve.com (William Harris) >Date: 11 Feb 1997 02:18:24 GMT >X-Informix-List-Id: <news.33740> > >In article <32F869A4.1B00@halstenbach.de>, mkwt@halstenbach.de says... >>the typ of a "count (*)" has changed from Informix V5 to V7 from >>integer to decimal. > >This may be of minor interest to some. Of major concern to me is the change >in select types from character to blob. Select "" from anything, in Informix >5, returns a character type. The same select returns a BLOB type in Informix >7. #include <stdio.h> int main(int argc, char **argv) { EXEC SQL BEGIN DECLARE SECTION; char *dbname = "stores"; int coltype; EXEC SQL END DECLARE SECTION; if (argc > 1) dbname = argv[1]; EXEC SQL WHENEVER ERROR STOP; EXEC SQL DATABASE :dbname; EXEC SQL PREPARE p_select FROM "select '' from 'informix'.systables where tabid = 1"; EXEC SQL ALLOCATE DESCRIPTOR 'd_select' WITH MAX 1; EXEC SQL DESCRIBE p_select USING SQL DESCRIPTOR 'd_select'; EXEC SQL GET DESCRIPTOR 'd_select' value 1 :coltype = TYPE; printf("Type number = %d\\n", coltype); return(0); } This returns type number 13 (SQLVCHAR; the column length info specifies VARCHAR(0)) for me, on Sparc 10 running Solaris 2.5.1 with ESQL/C & OnLine & SE 7.21.UC1. Are you getting confused with type 113, CLOCATORTYPE, which would be the same as a blob? >This is of major significance because under Informix you can't select blobs >into or out of anything. While cussing Informix out mightily, you have to use >locator fields and all kinds of crap to get the contents of even innocent text >blobs. > >It's of major inconvenience when someone who (innocently not knowing >otherwise) wants to add "" fields to his select statement (maybe because of a >union with some other select, maybe because it fits with the database tool >he's using). It would be a major nuisance if it were what happened. I have shown a counter-example which demonstrates to my satisfaction that it does not happen thus -- blobs are not returned in place of a null string. It is the only place I know of where SE returns a VARCHAR variable, though! Yours, Jonathan Leffler (johnl@informix.com) #include <disclaimer.h>