Some details of how MS Server and Oracle handle NULL differ

  • 2020-06-23 02:09:58
  • OfStack

INSERT INTO Table (TestCol) VALUES(')
TestCol fields, which is in the design, has been designed for NOT NULL, but we need to know about 1 PM, in sql server, null and Spaces are different, that is to say, the above statements insert is an empty, but not NULL, only when we don't have the fields in the insert statement, will only be considered in violation of the conditions is not empty, there may be expressed in English may be more accurate 1, if the NULL translated as "empty", can be easily mixed up. In addition, if our field is of INT type, we get a zero if we insert nothing, that is, MS Sql server will automatically handle the conversion of Spaces for us.

In Oracle, however, this convenience does not exist, and we have to follow the strict rules of insertion. That is, if we want the view to satisfy the design constraints of NOT NULL by inserting empty space, we will no longer succeed. We have to insert actual content to satisfy the design constraints of NOT NULL.

Like similarly 1 some details in our design should not only meet the MS Sql, and when they meet Oracle system, in particular will be we need to deal with common, this aspect requires that we will strictly regulate our sql script, moreover also want to strictly control the conditions of application processing statements, or similar problems in alignment time will let us into the nightmare ~ 1 and 1

Related articles: