jph_tours
19th October 2020, 23:53
Hi,

I created a data flow from ION desk that populates a table designed in ERP LN.

Since the table definition contains a Blob field, I need to fill in a field of type uuid.

I am using microsoft sql server and tried using T-SLQ NEWID function. After converting to varbinary, it seems that this uuid is not valid for ERP LN.
(Using GTM to read this new record I get a fatal Error)

Does anyone have a solution to generate a well formatted UUID?

Thank you for your help.

bdittmar
21st October 2020, 09:28
Hello,

UUID overview
A UUID (Universally Unique IDentifier) is a 128 bit pattern generated according to a certain standard. A UUID generated according to this standard is guaranteed (or is extremely likely) to be different from all other UUIDs generated by the same or any other bshell at the same or any other time (until 3400 A.D.) on the same or any other computer.

The function uuid.generate$() generates a UUID and returns the so called 'compact string' representation of the UUID. The compact string representation of a UUID is equal to its Base64 encoded representation, with the two final padding characters (==) chopped off. The result is a readable 22 character string, composed from the Base64 character set, e.g. "Fyk4JE1NEdaO4AgACdpw/w".

The function uuid.format$() returns the so called 'standard string' representation, e.g. "17293b6c-4d4d-11d6-af08-080009da70ff" for the supplied compact string representation of a UUID. The standard representation of a UUID is a readable 36 character string, composed from 32 hexadecimal digits and 4 dashes (-) at fixed places.

In The debugger the /g option can be used to display the standard string representation for a compact string representation of a UUID.

See UUID Internet Draft Standard for a (draft) description of the standard and for further references.


uuid.generate$()
Syntax:
function string uuid.generate$ ()

Description

Generates a UUID and returns its compact string representation, e.g. "Fyk4JE1NEdaO4AgACdpw/w".


Return values
The compact string representation of the generated UUID is returned, e.g. "Fyk4JE1NEdaO4AgACdpw/w".

The size of the compact string representation of a UUID is given by the predefined constant UUID.SIZE.COMPACT. Its value is 22.

Context
This function is implemented in the porting set and can be used in all script types.


Regards