Oracle 指令碼中特殊字元轉義

來源:互聯網
上載者:User

Oracle中,大家都知道兩個單引號之間包含的為字元型,但是如果需要在指令碼中編寫單引號應該如何編寫。當然用''''(4個單引號)也是可以組裝成一個單引號。

大家在plsql中,如何把含有斷行符號的文字用update的形式更新到資料庫中?

這時候就需要用到轉義:

轉義有兩種,一種是把字串轉義成asc碼,另一個就是把asc碼會變成字串。

範例如下:

select chr(92) from dual;

select ascii('\n') from dual ;

如果需要找到單引號(')對應的ascii碼,應該如何處理呢?

select ascii('''') from dual ;

over,結案!

相關文章

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.