on 01-24-2019 6:50 AM
how do we take an existing HANA Guid and convert it to what CDS will accept and map to an OData edm.guid?
Context
I am using data across a number of different sources. the key that links the data is a guid
I am having troubles getting the existing guid to parse as an OData edm.guid, NodeJS OData V4
Background
I read this in the help - Using UUIDs
By default, CDS maps UUIDs to nvarchar(36) in SQL databases. The length is to accommodate representations with hyphens as well as any other.
It is expecting nvarchar(36) with the hashes, an existing guid is saved in HANA as nvarchar(32) sans hash
Work Around
in SQLScript I can use a REGEX to do the dashes
SELECT
REPLACE_REGEXPR('(.{8})(.{4})(.{4})(.{4})(.*)' IN "DB_KEY" with '\1-\2-\3-\4-\5') as "DBKey"
FROM "My.ExternalView"
makes
"DB_KEY": 0060768214261ED886C1D048C5E5B699
"DBKey" : 00607682-1426-1ED8-86C1-D048C5E5B699
How to do that in CDS, can i use a formatter or a custom type?
User | Count |
---|---|
88 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.