In Oracle, you can use the reverse function to reverse a string. The function of this function is to reversely convert an object. The syntax is "select reverse('String to be reversed') from dual;"; This function is to reverse the encoding of objects stored inside the database. What is stored is not the result of direct encoding, but after some kind of internal conversion.
The operating environment of this tutorial: Windows 10 system, Oracle version 12c, Dell G3 computer.
Oracle provides a reverse function that can reversely convert an object.
For example:
Because this function reverses the encoding of objects stored in the database,
Therefore, for example: numbers, Chinese, etc. Because what is stored is not the directly encoded result. , but is achieved after some internal conversion. Therefore, after the conversion is completed, it may not be the result you want. Example:
SQL> select reverse(123456) ,reverse('×××') from dual; REVERSE(123456) REVERSE('×××') --------------- ------------------------- -668706000000 ?秃补衩巳?兄
In this place, an integer and a Chinese content are It has been converted into other content.
Let’s dump and see how Oracle reverses
SQL> select reverse(123456),dump(123456),dump(reverse(123456)) from dual; REVERSE(123456) DUMP(123456) DUMP(REVERSE(123456)) --------------- ------------------------- ------------------------- -668706000000 Typ=2 Len=4: 195,13,35,57 Typ=2 Len=4: 57,35,13,195
Recommended tutorial: "Oracle Video Tutorial"
The above is the detailed content of How to reverse oracle string. For more information, please follow other related articles on the PHP Chinese website!