Some detail differences in null processing in MS server and Oracle _oracle
Source: Internet
Author: User
INSERT into Table (testcol) VALUES (')
The Testcol field, in fact, has been designed to be not null at design time, but we need to understand that NULL and whitespace are different in SQL Server, that is, the above statement inserts an empty, but is not NULL, Only when we do not have the field in the INSERT statement will be considered to violate the non-null constraints, here may be more accurate expression in English, if the null translation to "empty", it may be easy to confuse the. Also, if our field is of type int, we get a 0 if we insert it, which means that MS SQL Server automatically handles the conversion of spaces.
But in Oracle, this convenience does not exist, we have to strictly follow the rules to insert, that is, we think that the view through the insertion of empty to meet the design constraints of NOT NULL, it is not successful, we must insert real content to meet the constraints of not NULL.
Like some details in our design both to meet Ms Sql, but also to meet Oracle's system, especially as we need to deal with the potluck, which requires us to strictly standardize our Sql script, and in addition to the program to deal with strict conditional control of the sentence to do, Otherwise a similar problem in the Union will let us fall into one nightmare after another ~
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.