在sql/oracle中对电子邮件/邮政编码字段进行验证 [英] validation on email / postcode fields in sql/oracle

查看:263
本文介绍了在sql/oracle中对电子邮件/邮政编码字段进行验证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于以下建议,我们将不胜感激-是否可以通过oracle中sql中的某种检查约束来验证电子邮件和邮政编码字段?还是这种东西,因为我怀疑带有正则表达式的pl/sql?

Would be gratefull for some advice on the following - Is it possible to validate email and postcode fields through some kind of check constraint in the sql in oracle ? or this kind of thing as i suspect pl/sql with regular expressions ?

谢谢

推荐答案

如果您只关注美国,则可以通过平面文件格式获取多种邮政编码来源,并将其导入表中,并且然后在您的地址中对该表应用外键约束.

If you're only concerned with the US, there are several sources of zip codes that you can obtain in flat-file format and import into a table, and then apply a foreign key constraint in your addresses to that table.

可以将电子邮件地址与正则表达式进行匹配(需要10g或更高)以验证格式,但是要检查电子邮件地址是否为实际地址是一件非常困难的事情.

Email addresses can be matched against a regular expression (needs 10g or higher) to validate the format, but checking to see if they are actual addresses is a much more difficult task.

这篇关于在sql/oracle中对电子邮件/邮政编码字段进行验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆