Definition:
In Oracle PL/SQL, the REFTOHEX function converts an input argument of the REF data type to its character hexadecimal equivalent. It is same as the REF value of the instance.
Example Syntax:
REFTOHEX(x)
Example Usage:
The example below shows the declaration of a REF column, data insertion, and using the REFTOHEX function. Note that it cannot be used with the column, which is not of REF type.
CREATE OR REPLACE TYPE TYP_REFT AS OBJECT
(A NUMBER,
B NUMBER);
/
Type created.
CREATE TABLE REFTT OF TYP_REFT;
Table created.
CREATE TABLE REFTAB
(ID NUMBER,
PID REF TYP_REFT);
Table created.
INSERT INTO REFTT VALUES (1,2);
1 row created.
INSERT INTO REFTAB
SELECT 1, REF(T) FROM REFTT T
1 row created.
SQL> SELECT REFTOHEX(PID) FROM REFTAB;
REFTOHEX(PID)
--------------------------------------------------------------------------------
00002202086F2A5BC83EC7440E97984B2C9EA9D9FEB2393991A58C4229897D0F775122F006
Related Links:
Related Code Snippets:
- REFTOHEX - REFTOHEX converts argument expr to a character value containing its hexadecimal equival...
