Detailed differences in NULL processing in MS Server and Oracle

Source: Internet
Author: User

Insert into Table (TestCol) VALUES ('')
The TestCol field has been designed as not null during design, but we need to know that in SQL server, null and space are different, that is, the preceding statement inserts an empty field, but is not NULL. It is considered to be a violation of non-NULL condition constraints only when this field is not inserted in our insert statement, here, the expression in English may be more accurate. If NULL is translated into "NULL", it may be easy to confuse. In addition, if our field is INT type, if we insert null, it will get a 0, that is, the MS SQL server will automatically help us handle the conversion of spaces.

However, in Oracle, this convenience does NOT exist. We must strictly follow the rules for insertion. That is to say, we want to meet the design constraints of not null by inserting NULL in the view, it is no longer successful. We must insert actual content to conform to the not null constraint.

Similar to some details, when we design a system that meets both MS SQL and Oracle, it is especially common for us to deal with it, in this aspect, we must strictly regulate our SQL scripts, and strictly control the program processing statements, otherwise, the joint debugging will bring us into a nightmare ~

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.