« Home | Oracle Database 10g: Top Features for DBAs Release... » | Project Lockdown 2 » | Build Your Own Oracle RAC 10g Release 2 Cluster on... » | Inserting Custom Messages in Oracle Alert/Trace files » | Virtual Indexes in Oracle » | Project Lockdown » | 11g Performance & Scalability Features » | Bryce DeWitt »

Approach 4: Using Regular Expressions

今日はDBAsupportからSQLに関する記事をご紹介します。

企業の合併が盛んに行われる中、企業のDataBaseに
登録されているコード体系をもう一方の企業に合わせ
なければならない場合もあると思います。

そんな時に便利なSQL関数やSQL手法が
この記事では紹介されています。

もうご存知の方も多いかもしれませんが、
記事で紹介されているregexp_like関数はたしか
10gからの新機能だったと思います。
(記事作成者はいつのバージョンからの機能だか
忘れてしまっているようですが)
UNIXなどで良く使用する正規表現をSQLでも
使用できるようにしたもので今回の例以外でも
活用することができると思います。


■ この記事のトップページ
http://www.dbasupport.com/

■ 引用ページ
http://www.dbasupport.com/oracle/ora10g/NumbersAndLetters.shtml


_________________________
 ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄
記事本文
_________________________
 ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄
◆ 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.

_________________________
 ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄
英語の語順に近い解釈
_________________________
 ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄
※英語を素早く理解する癖をつけるためにあえて
不自然な日本語で、英語の語順で訳しています。

翻訳を仕事とする予定が無い限り、
自然な日本語に訳してから解釈するよりも
目に飛び込んできた英語からどんどん
解釈していくことをお勧めします。


◆ Approach 4: Using Regular Expressions
正規表現の使用

A new feature in Oracle (which release?)
Oracleの新機能(どのリリース?)

deals with regular expressions.
正規表現を扱う。

Long a mainstay of other languages (to include UNIX),
長く、他の言語のメインサポータである(UNIXを含む)

regular expression functionality had been missing from Oracle.
正規表現の機能性はOracleから欠けていました。

This approach is so simple and elegant
このアプローチはとてもシンプルで、エレガントです。

to use
使うのに

that you may wonder
それはあなたが考えてしまいます。

why the other three were even mentioned
何故、他の3つの方法が述べられたのかと、

in the first place.
先に

The only requirement for using REGEXP is that
REGEXP関数を使うのに唯一の要求は

you must be using,
あなたが必ず使用すること

obviously,
明白に

a version of Oracle that supports it.
Oracleのバージョン、それをサポートする

You know
あなたは知っています。

there are companies
会社が存在することを

still using version 7.3.4,
未だに7.3.4のバージョンを使用している。

and given that
そして与えられた、

REGEXP first appeared several versions later,
REGEXPが最初に登場したのは数バージョン後だったことを

well, that answers
ですから、それが答えです。

why the other approaches merit consideration.
何故、他のアプローチが考えるに値する。

_________________________
 ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄
解釈のポイント
_________________________
 ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄

◆ Approach 4: Using Regular Expressions
正規表現の使用
(※)regular expressions
= 正規表現。UNIXのコマンドで良く使用される特殊な文字列表現
複数の対象文字列を1つの表現で表現する方法
例)a*cと表現すると、abcもabbbcもa88777cも対象文字列となる。


A new feature in Oracle (which release?) deals with regular expressions.
(※)deals with = 扱う、取引する

Long a mainstay of other languages (to include UNIX),
(※)mainstay = 大黒柱、メインで支える人

regular expression functionality had been missing from Oracle.
(※)functionality = 機能性

there are companies still using version 7.3.4,
(※)7.3.4 = 7.3.4を使用している商用DBはまだ結構あります。


_________________________
 ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄
解説
_________________________
 ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄
この記事の前提として、REGEXP関数が提供されたのは
10gからであり、7.3.4では使用できないこと、
また、この文の直前に3つの別の機能が紹介されているが、
regexp関数があれば前の3つの説明は無駄だったのでは
無いかと読者が感じてしまうことなどを理解していると
文章の意味が理解しやすいと思います。

regexp関数はunixの正規表現に慣れている方には
本当に嬉しい新機能だと思います。
昔からlike句があり、主に%や_でワイルドカードを表現
できましたが、もっと多彩な表現が可能です。

About me

  • I'm yaksa
  • From Tokyo, Japan
My profile
にほんブログ村 IT技術ブログへ

blogRanking