nulls in sqlda
Posted in 1993
I'm currently working on version 1.2 of isqlperl, and I'm a bit puzzled about some of the details of the sqlvar_struct structure, specifically that there appear to be two ways (three if you count struct loc_t's) of specifying a null value using indicators. (this is SE/OL 4.10) I can get both ways to work, but I'd feel more comfortable if I understood the reasoning behind this: 1) you can simply point `short *sqlind' at a short with a negative value. 2) you can point `char *sqlidata' at any data type, and set `short sqlilen' and `short sqlitype' accordingly. 3) With blobs, you can leave the indicators in the sqlvar_struct NULL, and set ((loc_t) sqlvar_struct->sqldata).loc_indicator to -1. Could someone possibly answer these few questions: a) what is the reasoning behind catering for arbitrary indicator variable types? b) of the three alternatives for blobs, which combinations of alternatives yield a null value. for example: sqlind NULL &-1 NULL &-1 NULL &-1 NULL &-1 sqlidata NULL NULL &-1 &-1 NULL NULL &-1 &-1 loc_indicator -1 -1 -1 -1 0 0 0 0 RESULTING NULL ? ? NULL NOT ? ? NULL? BLOB NULL Basically, do both sqlind and sqlidata have to agree, and if not, which has priority in identifying a NULL field? c) of the various approaches, which is the safest/most appropriate? -- Cheers Bill =========================================================================== | Bill Hails <bill@tardis.co.uk> | Reisner's rule of conceptual inertia: | | C.L.I. Connect Ltd. | | | 19, Quarry St., Guildford, Surrey | If you think big enough, you'll never | | GU1 3UY. Tel (UK) 0483 300 200 | have to do it. | ===========================================================================