当前位置: 首页 > 图文教程 > 网络编程 > ASP.NET > Oracle 数据库中的 empty string 处理

ASP.NET
Web服务器控件:LinkButton控件
Web服务器控件:ListBox控件
Web服务器控件:ListItem控件
Web服务器控件:Literal控件
Web服务器控件:Panel控件
Web服务器控件:PlaceHolder控件
Web服务器控件:RadioButton控件
Web服务器控件:RadioButtonList控件
Web服务器控件:BulletedList控件
Web服务器控件:Style控件
Web服务器控件:Table控件
Web服务器控件:TableCell控件
Web服务器控件:TableRow控件
Web服务器控件:TextBox控件
Web服务器控件:XML控件
Validation服务器控件:CompareValidator控件
Validation服务器控件:CustomValidator控件
Validation服务器控件:RangeValidator控件
Validation服务器控件:RegularExpressionValidator控件
Validation服务器控件:RequiredFieldValidator控件

ASP.NET 中的 Oracle 数据库中的 empty string 处理


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-11-03   浏览: 180 ::
收藏到网摘: n/a


跟 微软的数据库产品不一样, Oralce 把 '' 空的string 自动替换为 Null
所以下面的代码你可能考虑不一样的结果.create table suppliers( supplier_idnumber,supplier_name varchar2(100));
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 中返回第二条记录,而 Oracle 返回空.他会把NULL 等同 ''所以 select * from suppliers
where supplier_name is null;返回所有的非空记录,包括null 和 ''微软也有一篇KB Q225070 PRB: Oracle Servers Convert Empty Strings to NULL