Quick Search:
CODE
Oracle PL/SQL Code Library
JOBS
Find Or Post Oracle Jobs
FORUM
Oracle Discussion & Chat
 The Oracle PL/SQL REFTOHEX Function      [Return To Index] Jump to:  
  Looking for the original pages? (formerly called "Morgan's Library") You can find them here.

Term: REFTOHEX

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...
 
Home      :      Code Library      :      Sponsors      :      Privacy      :      Terms of Use      :      Contact Us 324 users online    © 2009 psoug.org
PSOUG LOGIN
Username: 
Password: 
Forgot your password?