How to Escape Characters in Oracle PL/SQL QueriesどのようにOracleのPL / SQLのクエリの文字をエスケープする

Oracle databases reserve some special characters with specific meaning and purpose within Oracle environment. OracleデータベースとOracle環境内で特定の意味を目的としたいくつかの特殊文字を留保します。 These reserved characters include _ (underscore) wild card character which used to match exactly one character, % (percentage) which used to match zero or more occurrences of any characters and ‘ (apostrophe or quotation mark) which used to mark the value supplied.これらの予約文字を含める_ (アンダースコア)は、これと' (または二重引用符)の値をマークするために使用さアポストロフィ任意の文字の0回以上の出現にマッチするために使用さ(パーセンテージ) %正確に1文字と一致するように使用されるワイルドカード文字を提供します。 These special characters will not be interpreted literally when building SQL query in Oracle, and may caused error in results returned especially when performing string search with LIKE keyword.これらの特殊文字を文字通りときにOracleのSQLクエリを構築し、解釈されません結果にエラーが発生することがありますが、特に文字列のLIKEキーワードで検索を実行戻った。 To use these characters so that Oracle can interpret them literally as a part of string value instead of preset mean, escape character has to be assigned.これは、 Oracle 、文字通りのプリセットの代わりに文字列値の一部として意味を解釈することができますこれらの文字を使用するには、割り当てられた文字をエスケープする必要があります。

Oracle allows the assignment of special escape characters to the reserved characters in Oracle can be escaped to normal characters that is interpreted literally, by using ESCAPE keyword. Oracleは、 Oracleでの予約文字に特別なエスケープ文字の割り当てを通常の文字は、文字通り、 ESCAPEキーワードを使用して解釈されて脱出することができますすることができます。

For example, to select the name of guests with _ (underscore) in it, use the following statement:たとえば、次のステートメントを使用するとユーザーの名前に_ (アンダースコア)を選択してください:

SELECT guest_name FROM guest_table WHERE name LIKE ‘%\_%’ ESCAPE ‘\’; SELECTをguest_nameからのLIKE ' %名guest_table \ _ % '避難口' \ ' ;

Without specifying the \ (backslash) as escape clause, the query will return all guest names, making the unwanted results problem.は、 \ (バックスラッシュを指定する)としてエスケープ句がなければ、クエリは、不要な結果の問題をすべてのユーザーの名前が返されます。

The above syntax will not work on ‘ (quote).上記の構文の' (引用符)は動作しません。 To escape this quotation mark and to display the quote literally in string, insert another quote (total 2 quotes) for every quote that want to be displayed.この二重引用符をエスケープするには、文字通り文字列の引用を表示するには、別の引用符が表示されるようにしたいすべての引用符(合計2引用符)を挿入します。 For example:例えば:

SELECT ‘This will display line with quote’’s word.’ FROM temp_table; 'このquote'の言葉でラインが表示されます]を選択します。 temp_tableからです。
SELECT ‘This will display ””double quoted”” word.’ FROM temp_table; 『これが表示されます" " SELECTをダブル" "言葉を引用。 temp_tableからです。

will return the following respectively:は、次のそれぞれが返されます:

This will display line with quote’s word.この引用の言葉でラインが表示されます。
This will display ”double quoted” word.この"ダブル"という言葉を引用表示されます。

IMPORTANT : This is a machine translated page which is provided "as is" without warranty. 重要 :これはマシンとして"保証なしにされている"提供されているページを翻訳しています。 Machine translation may be difficult to understand.機械翻訳を理解するのが難しい場合があります。 Please refer toを参照してください original English articleオリジナルの英語の記事 whenever possible.可能な場合。

Share and contribute or get technical support and help at共有して貢献するかを得る技術サポートと支援 My Digital Life Forums 私のデジタルライフフォーラム .



3 Responses to “How to Escape Characters in Oracle PL/SQL Queries” 3レスポンス"どのようにOracleのPL / SQLのクエリに"文字をエスケープする

  1. Escape Character in MySql - Discussweb IT Community - Web Development, Software Programming, SEO, Quality Assurance, 3D, Web Hosting and more... MySQLのエスケープ文字-D iscusswebのI Tコミュニティ-ウェブ開発、ソフトウェアプログラミング、S E Oのは、品質保証、3次元は、 W e bホスティング、その他.. .
    July 13th, 2007 19:27 2007年7月13日19:27
    1

    [...] about Escape Characters.エスケープ文字[...] 。 Escape Characters Oracle Wildcards Wildcard Characters Escape Character How to Escape Characters in Oracle PL/SQL Queries Oracleのワイルドカードワイルドカード文字をエスケープ文字をエスケープ文字をどのようにOracleのPL / SQLのクエリの文字をエスケープする

  2. sam33
    September 17th, 2008 20:44 9月17日、 2008年20:44
    2

    salut j’ai le mm pb ! salut j'aiルミリ鉛! si je fait une recherche sur le ‘_’ seul sa marche mais si v je chercher des mots avec le ‘_’市帝フェイトune抜きのシュールル' _ 'のsaマルケ市情報seul Vの帝Chercher -シャルシェデm ots備えたル' _ '
    exmple: exmple :
    SELECT * from Test WHERE nom LIKE ‘1%\_%test’ ESCAPE ‘\’; * '1 %のテストのWHERE公称値のLIKEからのSELECT \ _ %テスト'避難口' \ ' ;
    sa me renvoie :土メインrenvoie :
    1_test
    10_test ?? 10_testか?
    or que normalement sa devait rendre que:またはしれませんnormalement土devait rendreしれません:
    1_test ?? 1_testか?
    je comprend pas帝comprendパ

  3. Charles AsbornsenチャールズAsbornsen
    September 26th, 2008 00:28 2008年9月26日00:28
    3

    Thank you very much - I’ma SQL Server gent with an Oracle source and I was going nuts!非常に多くの感謝-私はS QLS erverのゲントがO racleソースと、頭がおかしくなりそうだったよ! : )

Leave a Replyは、返信のままに

You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> これらのタグ :の<a href=""使用することができますtitle=""> <abbr title=""> <acronym title=""> <b>ダウンロード<blockquote cite=""> <cite>の<code> <デル日時= " " >の<em> <i> <q cite=""> <strike> <strong>

Subscribe without commentingチャンネル登録コメントなし


Custom Search

New Articles新しい記事

Incoming Search Terms for the Article着信は、文書の検索利用規約

oracle escape character Oracleのエスケープ文字 - - oracle sql escape オラクルのSQLエスケープ - - pl sql escape character 1043のSQLエスケープ文字 - - Oracle escape characters Oracleのエスケープ文字 - - oracle sql escape character オラクルのSQLエスケープ文字 - - oracle quote escape Oracleの引用を免れる - - PLSQL escape character PLSQLエスケープ文字 - - escape characters oracle エスケープ文字をオラクル - - escape character in sqlエスケープ文字のSQL - - SQL escape & のSQLエスケープ& - - sql escape のSQLエスケープ - - special character in oracleオラクルの特殊文字 - - escape character in oracle Oracleのエスケープ文字 - - oracle, sql, escape character オラクルは、 SQL 、文字のエスケープ - - oracle escape & Oracleの脱出& - - Oracle escape ' Oracleの脱出' - - oralce import excape char oralce輸入excapeチャー - - pl/sql find percent character in clause のSQL句で%文字/見つける1043 - - SQL escape character のSQLエスケープ文字 - - escape SQLのSQL エスケープ - - escape character oracle Oracleの文字のエスケープ - - escape character for oracle pl/sql Oracleの1043の文字/ SQLの脱出 - - oracle escaping Oracleのエスケープ - - oracle sql & escape オラクルのSQL &エスケープ - - oracle escape Oracleの脱出 - - pl/sql escape string PL / SQLのエスケープ文字列 - - pl sql escape quote 1043のSQLエスケープ引用 - - plsql escape plsqlエスケープ - - special character in search string SQL oracle 検索文字列のSQL Oracleの特殊文字 - - sql character escape のSQL文字のエスケープ - - escape characters in oracle Oracleエスケープ文字 - - find special character in string PL/SQL 文字列中の特殊文字を検索する PL / SQLの - - oracle insert error with special characteres 特別characteresとOracleの挿入エラー - - oracle sql escape & character オラクルのSQLエスケープ&文字 - - PL SQL ESCAPE CHAR 1043のSQLエスケープ文字 - - select oracle escape Oracleの脱出を選択してください - - sql escape characters のSQLエスケープ文字 - - character oracle 文字のOracle - - character escaping poland 文字をエスケープするポーランド - - display characters ¿ instead of ' in oracle 表示文字の代わりに' Oracleの ¿ - - display special characters+oracle database 特殊文字を表示+ Oracleデータベース - - escape apostrophes oracle 脱出アポストロフィオラクル - - escape characters used in Inserts in Oracle 10g エスケープ文字を挿入でをOracle 10gで使用される - - escape sql wild character 野生のSQL文字のエスケープ - - escape+apostrophe+oracle エスケープ+アポストロフィ+オラクル - - escape sql entry のSQLエントリを免れる - - escape character for quote in sql に引用符をエスケープ文字のSQL - - escape '/' character in sql in oracle エスケープ' / ' OracleのSQLで文字 - - escape sequences in oracle Oracleエスケープシーケンス - - escaping special character + oracle 特殊文字をエスケープ+オラクル - -