Different Values of RAWTOHEX in Oracle 12c and 11g [message #676756] |
Fri, 12 July 2019 07:48 |
Manoj.Gupta.91
Messages: 239 Registered: March 2008 Location: Delhi
|
Senior Member |
|
|
Hi All,
I'm facing an issue with RAWTOHEX value function where it is generating different values for the same input on two different database versions i.e. Oracle 11.2.0.1.0 Enterprise Edition and Oracle 12.1.0.2.0 Enterprise Edition.
[b]Oracle 12.1.0.2.0[/b]
select rawtohex( 'š‡ÏAï®À') FROM DUAL ;
C5A1E280A1C38F41C3AFC2AEC38012
[b]Oracle 11.2.0.1.0[/b]
select rawtohex( 'š‡ÏAï®À') FROM DUAL ;
9A87CF41EFAEC012
Please help me to understand why the output values are different in two different oracle versions. Ideally same value should have been returned.
Thanks & Regards
Manoj
|
|
|
|
|
Re: Different Values of RAWTOHEX in Oracle 12c and 11g [message #676762 is a reply to message #676756] |
Fri, 12 July 2019 10:31 |
|
Michel Cadot
Messages: 68653 Registered: March 2007 Location: Nanterre, France, http://...
|
Senior Member Account Moderator |
|
|
In addition to Solomon answer, here's an abstract of the documentation:
Quote:RAWTOHEX converts raw to a character value containing its hexadecimal representation
It is obvious that 'š‡ÏAï®À' is NOT a RAW data but a CHAR one.
So you have first an implicit conversion from CHAR to RAW before the function applies and so the dependence on the database character set hence Solomon's question.
[Updated on: Fri, 12 July 2019 10:37] Report message to a moderator
|
|
|