`
zgqynx
  • 浏览: 1370652 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

Oracle and the Ampersand (&)

阅读更多
http://www.etstiles.com/?q=node/7
Oracle and the Ampersand (&)
Submitted by ets04uga on Tue, 11/06/2007 - 3:28pm.

    * Ampersand
    * Escape Character
    * Oracle

So I was looking around and couldn't seem to find out how to insert ampersand into an Oracle XE database, outside of SQL*Plus as in the following example:

INSERT INTO TABLE (COL1) VALUE ('A & B');

Normally one might try the standard backslash('\') as an escape character. One would be wrong.

I'm not sure of every possible solution, but found a quick (and seemlingy dirty) solution where the ampersand needs to be at the end next to a single quote. The following is the current solution I am using until a betters/best approach is found:

INSERT INTO TABLE (COL1) VALUE ('A &'||' B');

Hope this helps.
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics