Oracle: Separating Numbers and Letters

The VALUE_ERROR handler didn′t catch the ORA-01858 condition and is why the output shows the SQL error message. The inner exception block can be modified to catch/test for specific error numbers, but accounting for all of the possible types of errors of this nature quickly makes the date approach – at least as far as the account number conversion project is concerned – somewhat cumbersome. Our last approach is elegant and easy to implement. 数据挖掘交友

Approach 4: Using Regular Expressions

A new feature in Oracle (which release?) deals with regular expressions. Long a mainstay of other languages (to include UNIX), regular expression functionality had been missing from Oracle. This approach is so simple and elegant to use that you may wonder why the other three were even mentioned in the first place. The only requirement for using REGEXP is that you must be using, obviously, a version of Oracle that supports it. You know there are companies still using version 7.3.4, and given that REGEXP first appeared several versions later, well, that answers why the other approaches merit consideration. 数据挖掘研究院

So what does REGEXP_LIKE do for us? Let′s go straight to the "only digits" search condition.

数据挖掘工具

SQL> select acctnum from account_test
  2  where regexp_like (acctnum,′^[[:digit:]]+ 数据挖掘研究院 

Again, a slight modification to the query will filter out the too short 009341 number. The REGEXP_LIKE function performs exactly the same as the first approach using TRANSLATE, that is, results come back one way or the other.

A Slight Extension

Taking either the first or last approach and converting the query/returned result into a function call adds an extremely useful utility users/Oracle have been missing since day one. How do you test for "not a number" or "is a number" in Oracle? By using the first or last approach, you just performed that test. Turn it into a function returning true or false, and grant execute permissions as appropriate, and you can now perform NaN(whatever) tests.

上一页 1 2 3 4 56 7 下一页
[数据挖掘专家] [数据挖掘研究院] [数据挖掘论坛] [数据挖掘实验室]
上一篇:IBM放出“毒蛇”欲一统数据库市场
下一篇:DBA from Crisis to Confidence
最新评论共有 0 位网友发表了评论 , 查看所有评论
发表评论( 不能超过250字,需审核,请自觉遵守互联网相关政策法规。 )
匿名?
数据挖掘网站导航 数据挖掘论坛导航
  • 数据挖掘工具
  • 数据挖掘论坛
  • DataCruncher - Cognos
  • MineSet - MathSoft
  • Intelligent Miner - GainSmarts
  • Sqlserver - SAS - Clementine
  • CART - Weka - WizSoft
  • NeuroShell - ModelQuest
  • data mining tools - Darwin
  • 数据挖掘交友
  • 数据挖掘博客
  • 数据挖掘工具
  • 数据挖掘资源
  • 数据挖掘技术算法
  • 数据挖掘相关期刊、会议
  • 研究院联盟合作专区
  • 数据挖掘基础与相关技术
  • 数据挖掘厂商与就业
  • 数据挖掘研究者乐园
  • 知名厂商数据挖掘工具资料
  • 国内数据挖掘实验室
  • Foreign Data Mining Lab
  • 热点关注
  • IBM放出“毒蛇”欲一统数据库市场
  • Oracle Delivers New Release of PeopleToo
  • Oracle: Separating Numbers and Letters
  • DBA from Crisis to Confidence
  • [Oracle]创建索引对SQL语句执行的影响
  • Oracle9i数据挖掘介绍
  • Oracle TimesTen In-Memory Database
  • Oracle 10G数据库的特性简介
  • Oracle RAC Administration - Part 13: Cac
  • 用Oracle分层管理器实现有效存储数据
  • 论坛最新话题
  • Foundations of Statistical Natural Langu
  • Game Theory meet Data Mining: A Recent P
  • System Building: How does it help or hin
  • 数据挖掘与Clementine培训
  • 新手报到
  • 求 SASEM 客户流失预测分析
  • 数据挖掘工程师/搜索研究院—北京——无线
  • 数据挖掘入门介绍(如何着手数据挖掘)
  • Information Overload Survey Results
  • The INEX 2005 Workshop on Element Retrie
  • 相关资讯
  • Oracle 10g Backup Guide: A Small County
  • Oracle 10G数据库的特性简介
  • Oracle TimesTen In-Memory Database
  • Oracle9i数据挖掘介绍
  • Low–Cost, High–Performance Data Securi
  • Oracle DML Error Logging
  • ORACLE问题,每天10问(十一)
  • 浅析Oracle和SqlServer存储过程的调试、出
  • Oracle数据的异地自动备份
  • Oracle数据库在一台机器配置两个listener
  • 数据挖掘实验室资料
  • 数据挖掘博客地址
  • 数据挖掘实验室网站地址
  • Prepare for Medicare audits by using dat
  • 注册成为SAS用户与爱好者俱乐部会员
  • 水南梅
  • 明日烟
  • 新人报道
  • 下载
  • 厦门服务器托管,450元/月—0592-5177319 高
  • 买空间送域名--0592-5177319 高静