Calories? Steps? Heart rate? Sleep?
Find the right device for you with the Activity Tracker Showcase

User-defined function to convert from RAW(16) to a GUID in Oracle

by timvasil 1/20/2009 11:32:00 AM

CREATE OR REPLACE
FUNCTION RAWTOGUID
( RawData IN RAW
) RETURN VARCHAR AS

BEGIN

declare HexData varchar(32) := rawtohex(RawData);

begin
return
    substr(HexData, 7, 2)
    || substr(HexData, 5, 2)
    || substr(HexData, 3, 2)
    || substr(HexData, 1, 2)
    || '-'
    || substr(HexData, 11, 2)
    || substr(HexData, 9, 2)
    || '-'
    || substr(HexData, 15, 2)
    || substr(HexData, 13, 2)
    || '-'
    || substr(HexData, 17, 4)
    || '-'
    || substr(HexData, 21, 12);
end;

END RAWTOGUID;

 

Tags:

Oracle

Comments are closed

Search

Calendar

«  April 2015  »
SuMoTuWeThFrSa
2930311234
567891011
12131415161718
19202122232425
262728293012
3456789

View posts in large calendar

Recent comments

Archive