EMPTY STRING process in the Oracle database

xiaoxiao2021-03-06  80

Unlike Microsoft's database products, Oralce automatically replaces the '' empty String to null

So the following code you may consider a different result.

CREATE TABLE SUPPLIERS (Supplier_IDNumber, Supplier_Name Varchar2);

Next, We'll Insert Two Records Into this Table.

INSERT INTO Suppliers (Supplier_ID, Supplier_Name) Values ​​(10565, NULL);

INSERT INTO Suppliers (Supplier_ID, Supplier_Name) Values ​​(10567, ');

SELECT * from Suppliers where supplier_name = ''; // SQL Server Returns the second record, and Oracle returns to empty.

He will put NULL equivalence ''

So SELECT * from Suppliers where support_name is null;

Returns all non-empty records, including null and ''

Microsoft also has a KB Q225070 PRB: Oracle Servers Convert Empty Strings To Null

转载请注明原文地址:https://www.9cbs.com/read-121949.html

New Post(0)