Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 10.0.1 » UltraLite - Database Management and Reference » UltraLite SQL Function Reference » Alphabetical list of functions

STRING function [String] Next Page

STRTOUUID function [String]


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

Not needed in newer databases

In databases created before version 9.0.2, the STRTOUUID and UUIDTOSTR functions were needed to convert between binary and string representations of UUID values.

In databases created using version 9.0.2 or later, the UNIQUEIDENTIFIER data type was changed to a native data type. You do not need to use STRTOUUID and UUIDTOSTR functions with these versions.

For more information, see Data types in UltraLite.

Syntax

STRTOUUID( string-expression )

Parameters

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

Remarks

Converts a string in the format xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx , where x is a hexadecimal digit, to a unique identifier value.

This function is useful for inserting UUID values into a database.

See also
Standards and compatibility
Example
CREATE TABLE T1 (
   pk UNIQUEIDENTIFIER PRIMARY KEY, c1 INT );
INSERT INTO T1 ( pk, c1 )
VALUES ( STRTOUUID('12345678-1234-5678-9012-123456789012'), 1 );