[20120117]函数反转字符串reverse.txt

简介: [20120117]函数反转字符串reverse.txtSQL> select * from v$version ;BANNER----------------------------------------------------------------Oracle Database 10g Enterprise Edition Release 10.
[20120117]函数反转字符串reverse.txt
SQL> select * from v$version ;
BANNER
----------------------------------------------------------------
Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bi
PL/SQL Release 10.2.0.3.0 - Production
CORE    10.2.0.3.0      Production
TNS for Linux: Version 10.2.0.3.0 - Production
NLSRTL Version 10.2.0.3.0 - Production

SQL> select reverse('abcd 123') from dual;
REVERSE(
--------
321 dcba

 查看手册没有这么命令,估计是oracle内部使用的,存在一个问题,如果变量使用数值,出现如下错误:

SQL> select reverse(123) from dual;
REVERSE(123)
------------
  -9.900E+77

*** glibc detected *** double free or corruption (out): 0x000000000058d590 ***
rlwrap: warning: sqlplus killed by SIGABRT.
rlwrap has not crashed, but for transparency,
it will now kill itself (without dumping core)with the same signal

Aborted


在11G下测试:

SQL> select * from v$version ;

BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
PL/SQL Release 11.2.0.1.0 - Production
CORE    11.2.0.1.0      Production
TNS for Linux: Version 11.2.0.1.0 - Production
NLSRTL Version 11.2.0.1.0 - Production

SQL> select reverse('abcd 123') from dual ;
REVERSE(
--------
321 dcba

SQL> select reverse(123) from dual ;
select reverse(123) from dual
               *
ERROR at line 1:
ORA-00932: inconsistent datatypes: expected CHAR got NUMBER

目录
相关文章
|
3月前
split(), reverse(),join()等函数用法
split(), reverse(),join()等函数用法
|
1月前
|
Python
reverse函数
reverse函数。
12 0
将一个字符串的str的内容颠倒过来,并输出
将一个字符串的str的内容颠倒过来,并输出
|
11月前
|
C++
C++ 递归和非递归实现字符串反转 char *reverse(char *s)
C++ 递归和非递归实现字符串反转 char *reverse(char *s)
80 0
|
C语言 C++
将一个字符串str的内容颠倒(逆序)过来,并输出
将一个字符串str的内容颠倒(逆序)过来,并输出
261 0
将一个字符串str的内容颠倒(逆序)过来,并输出
C#编程:用Array.Reverse反转字符串-1
C#编程:用Array.Reverse反转字符串-1
132 0
HDU-1062,Text Reverse(字符串处理 and 栈)
HDU-1062,Text Reverse(字符串处理 and 栈)
C#编程:用Array.Reverse反转字符串
C#编程:用Array.Reverse反转字符串
339 0
|
索引 Python Java
LeetCode 557:反转字符串中的单词 III Reverse Words in a String III
公众号:爱写bug(ID:icodebugs) 给定一个字符串,你需要反转字符串中每个单词的字符顺序,同时仍保留空格和单词的初始顺序。 Given a string, you need to reverse the order of characters in each word within a.
900 0
|
Java 索引 Python
LeetCode 151:给定一个字符串,逐个翻转字符串中的每个单词 Reverse Words in a String
公众号:爱写bug(ID:icodebugs) 翻转字符串里的单词 Given an input string, reverse the string word by word. 示例 1: 输入: "the sky is blue" 输出: "blue is sky the" 示例 2: 输入: " hello world! " 输出: "world! hello" 解释: 输入字符串可以在前面或者后面包含多余的空格,但是反转后的字符不能包括。
1553 0

热门文章

最新文章