Contents Index STRING function [String] STUFF function [String]

ASA SQL Reference
  SQL Functions
    Alphabetical list of functions

STRTOUUID function [STRING]


Function 

Converts a string value to a unique identifier (UUID or GUID) value.

Syntax 

STRTOUUID( string-expression )

Parameters 

string-expression    A string in the format xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx

Usage 

Converts a string in the format xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx where x is a hexadecimal digit, to a unique identifier value. If the string is not a valid UUID string, NULL is returned.

This function is useful for inputting UUID values into an Adaptive Server Anywhere database.

Standards and compatibility 
See also 

UUIDTOSTR function [STRING]

NEWID function [Miscellaneous]

Example 
CREATE TABLE T (
   pk uniqueidentifier primary key,
   c1 int);
INSERT INTO T (pk, c1)
VALUES (STRTOUUID
    ('12345678-1234-5678-9012-123456789012'), 1);

Contents Index STRING function [String] STUFF function [String]