Oracle對字元轉義的處理

來源:互聯網
上載者:User

以前總是忘記Oracle單引號轉義,為了以後工作方便,現在記錄下來

SQL> select ''''||nvl(sql_id,prev_sql_id)||'''' sql_id ,  ',' ||nvl(sql_child_number,prev_child_number) sql_child_number from v$session where sid=159;

SQL_ID          SQL_CHILD_NUMBER
--------------- -----------------------------------------
'62d7qphq2zx20' ,0
對於單引號的轉義 只需要 '''' 就可以了

select object_name from test where object_name like 'I/_%' escape'/';

對於其他字元的轉義 ,可以利用 ORACLE內建的escape來轉

相關文章

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.