0
我遇到問題了!如何將.net guid轉換爲oracle raw(16)
我的問題是:如何將.net guid轉換爲oracle raw(16)?
我試了一下:
select cast('9e953501-51d1-4701-e053-470f0c0a8ed5' as RAW(16)) from dual;
,但它不工作...
我遇到問題了!如何將.net guid轉換爲oracle raw(16)
我的問題是:如何將.net guid轉換爲oracle raw(16)?
我試了一下:
select cast('9e953501-51d1-4701-e053-470f0c0a8ed5' as RAW(16)) from dual;
,但它不工作...
您需要使用utl_raw.cast_to_raw
:
select utl_raw.cast_to_raw('9e953501-51d1-4701-e053-470f0c0a8ed5') val
from dual
VAL
------------------------------------------------------------------------
39653935333530312D353164312D343730312D653035332D343730663063306138656435
select cast(replace('9e953501-51d1-4701-e053-470f0c0a8ed5','-') as RAW(16)) from dual;
select cast(translate('{9e953501-51d1-4701-e053-470f0c0a8ed5}','1234567890abcdef-{}','1234567890ABCDEF') as RAW(16)) from dual;