ID转换为友好的GUID

ID转换为友好的GUID

本文介绍了如何将DB2/Oracle中的FileNet ID ID转换为友好的GUID?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

IBM技术说明"

The IBM Technote "How to translate the unique identifier as displayed within FileNet Enterprise Manager so that it matches what is stored in the Oracle and DB2 databases" outlines how DB2 & Oracle store guids in a byte reversed order. How can I convert them into a friendly guid?

解决方案

The following code does the trick in DB2, following the recipe from the IBM Technote:

‘{’ concat  upper(VARCHAR_FORMAT_BIT(
 cast(substring(F.Object_id, 4, 1) concat
 substring(F.Object_id, 3, 1) concat
 substring(F.Object_id, 2, 1)  concat
 substring(F.Object_id, 1, 1)  concat
 substring(F.Object_id, 6, 1)  concat
 substring(F.Object_id, 5, 1)  concat
 substring(F.Object_id, 8, 1)  concat
 substring(F.Object_id, 7, 1)  concat
 substring(F.Object_id, 9) as char(16)), ‘xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx’)) concat ‘}’ as object_id

The "cast as char(16)" is a gotcha - casting to varchar(16) does not work on DB2 at least.

Here's the before and after:

这篇关于如何将DB2/Oracle中的FileNet ID ID转换为友好的GUID?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-23 16:28