Home  >  Article  >  Database  >  Oracle 脚本中特殊字符转义

Oracle 脚本中特殊字符转义

WBOY
WBOYOriginal
2016-06-07 17:05:201245browse

Oracle中,大家都知道两个单引号之间包含的为字符型,但是如果需要在脚本中编写单引号应该如何编写。当然用

Oracle中,大家都知道两个单引号之间包含的为字符型,但是如果需要在脚本中编写单引号应该如何编写。当然用''''(4个单引号)也是可以组装成一个单引号。

大家在plsql中,如何把含有回车的文字用update的形式更新到数据库中?

这时候就需要用到转义:

转义有两种,一种是把字符串转义成asc码,另一个就是把asc码会变成字符串。

样例如下:

select chr(92) from dual;

select ascii('\n') from dual ;

如果需要找到单引号(')对应的ascii码,应该如何处理呢?

select ascii('''') from dual ;

over,结案!

linux

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn