This article briefly introduces how to format SYS_GUID () in oracle to a standard format. If you need to learn more, you can see it.
This article briefly introduces how to format SYS_GUID () in oracle to a standard format. If you need to learn more, you can see it.
This article briefly introduces how to format SYS_GUID () in oracle to a standard format. If you need to learn more, you can see it.
In Oracle, RAW (16) is used to save SYS_GUID () results, but the byte order is different from the standard GUID. As follows:
Standard GUID: 265B113F-0E9D-F44D-A9D4-18BC4D3E836C
RAW (16): 3F115B26 9D0E 4DF4 A9D4 18BC4D3E836C (there is no space actually, this is for ease of display)
For ease of viewing, you can use simple conversion.
The Code is as follows: |
|
Create table t (x raw (16 )); Insert into t (x) Sys_guid () from dual connect by rownum <= 5; Commit; Select x, Regexp_replace (x, '(. {2 })(. {2 })(. {2 })(. {2 })(. {2 })(. {2 })(. {2 })(. {2 })(. {4 })', '2017-65-87-9-') as fmt_x From t; X FMT_X ---------------------------------------------------------------------------------------------------------------- B5D8E10BB3BCC595E040007F01000F49 0BE1D8B5-BCB3-95C5-E040-007F01000F49 B5D8E10BB3BDC595E040007F01000F49 0BE1D8B5-BDB3-95C5-E040-007F01000F49 B5D8E10BB3BEC595E040007F01000F49 0BE1D8B5-BEB3-95C5-E040-007F01000F49 B5D8E10BB3BFC595E040007F01000F49 0BE1D8B5-BFB3-95C5-E040-007F01000F49 B5D8E10BB3C0C595E040007F01000F49 0BE1D8B5-C0B3-95C5-E040-007F01000F49 |