Re: updating informix
Posted in 1992
Topics: Connectivity: ESQL/C, 4GL & Embedded SQL
In-reply-to: Your message of "Thu, 02 Apr 92 09:21:43 EST." <9204021421.AA18447@ddssuprs> ---------------------------------------------------------------- -------- Start of Included Message -------- } Harry Bochner <bochner@das.harvard.edu> writes: } } I just want to remind everyone that the NULL value is not spaces on a } CHAR variable, nor zero on a numeric variable. The NULL value is } 'I don't know'. NULL is more than "I don't know" it can also mean "inapplicable". That is, for that particular object that the row represents there are no valid values for that particular column. For example, we have at our department some without salary employees. Their salary fields are NULL not because it isn't known but because it is unknowable... inapplicable. As a reference read chapter 8 in Codd's new book _The relational model for database management: version 2_ (Addison-Wesley: 1990). If you have a column named salary, when you give it } the value zero that means that the poor guy has no salary, if the } value is NULL that means that you don't know what the salary is. Same } thing for a CHAR var, e.g. a middle name column: spaces is that the } guy doesn't have a middle name, NULL is again 'We don't know,' nobody } entered a middle name for this record. But in my example it would also mean that their should never be any information in this column for this row. Unless some other aspect of that object changes ... such as an appointment with salary. The distinction is subtle but I believe it is important. If I put a 0 in the column then I am saying that there is a salary and it is 0 but by having the value to be NULL am saying that it is either unknown or it is inapplicable. After writing the following section I am uncertian as the proper way the 4GL front end should deal with NULLs. ------------------------------------ Looking futher through the Codd book his RM-11 rule says that NULL's must be treated uniformily. Now it is true that he is dealing with the engine and not the front end but I think his logic should be applied there also. So Harry, while I think that 4.1 is consistent with the application of 4GL syntax regarding missing values and assignments. I will agree with you that the syntax it self is confusing and should be changed. So the request to Informix... is this sufficient Alan? ... when a variable is assigned to NULL or a NULL is assigned to a variable with existing information. The NULLness is retained... I understand that this would change the way things are initialized to NULL and would mean that this would be legal where it currently isn't: Let foo = NULL rather than Initialize foo To NULL -------------------------------- Now that I look at this last segment ... I am not confident that I am correct. Should the values of NULLs be assigned and evaluated the same way as information that is not missing? Right now ... I don't know. --------- End of Included Message ---------