Contents Index UPPER function [String] VAR_POP function [Aggregate]

ASA SQL Reference
  SQL Functions
    Alphabetical list of functions

UUIDTOSTR function [STRING]


Function 

Converts a unique identifier value (UUID, also known as GUID) to a string value.

Syntax 

UUIDTOSTR( uuid-expression )

Parameters 

uuid-expression    A unique identifier value.

Usage 

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

This function is useful if you want to view a UUID value.

Standards and compatibility 
See also 

NEWID function [Miscellaneous]

STRTOUUID function [STRING]

Example 

The following statement creates a table mytab with two columns. Column pk has a unique identifier data type, and column c1 has an integer data type. It then inserts two rows with the values 1 and 2 respectively into column c1.

CREATE TABLE mytab(
    pk uniqueidentifier primary key default newid(),
    c1 int )
INSERT INTO mytab( c1 ) values ( 1 )
INSERT INTO mytab( c1 ) values ( 2 )

Executing the following SELECT statement returns all of the data in the newly created table.

SELECT *
FROM mytab

You will see a two-column, two-row table. The value displayed for column pk will be binary values.

To convert the unique identifier values into a readable format, execute the following command:

SELECT uuidtostr(pk),c1
FROM mytab

Contents Index UPPER function [String] VAR_POP function [Aggregate]