Oracle SQL 插入特殊字元

來源:互聯網
上載者:User

對於插入資料庫資料的語句:
INSERT INTO TESTTAB(FIELD1) VALUES('測試')
如果插入資料庫的字串中還有單引號,需要轉義處理,如插入“It's a tree.”,SQL語句如下:
INSERT INTO TESTTAB(FIELD1) VALUES('It''s a dog.')
如果SQL中有“&”,那麼後面的字串將被作為一個變數來處理,無法正常插入資料庫。
如果的確需要把&字元插入資料庫,如下處理:
INSERT INTO TESTTAB(FIELD1) VALUES('I work in R'||'&'||'D.')

更多Oracle相關資訊見Oracle 專題頁面 http://www.bkjia.com/topicnews.aspx?tid=12

相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.