sqlparser/datatypes.cpp
// UNIQUEIDENTIFIER in SQL Server, Sybase ASA
UNIQUEIDENTIFIER in SQL Server, Sybase ASA
UNIQUEIDENTIFIER in SQL Server Sybase ASA
bool SqlParser::ParseUniqueidentifierType(Token *name)
{
    if(name == NULL)
        return false;
    bool uuid = false;
    bool in_braces = false;
	STATS_DECL
    if(name->Compare("UNIQUEIDENTIFIER", L"UNIQUEIDENTIFIER", 16) == true)
        uuid = true;
    else
        if(name->Compare("[UNIQUEIDENTIFIER]", L"[UNIQUEIDENTIFIER]", 18) == true)
            in_braces = true;
    if(uuid == false && in_braces == false)
        return false;
    if(Target(SQL_ORACLE, SQL_MYSQL, SQL_POSTGRESQL) == true)
        Token::Change(name, "CHAR(36)", L"CHAR(16)", 8);
    else
        if(_target != SQL_SQL_SERVER && in_braces == true)
            Token::ChangeNoFormat(name, name, 1, name->len - 2);
	STATS_ITM_DECL 
    DTYPE_STATS(name)
    DTYPE_DTL_STATS_0(name)
    return true;
}
bool SqlParser :: ParseUniqueidentifierType ( Token * name ) { if ( name == NULL ) return false ; bool uuid = false ; bool in_braces = false ; STATS_DECL if ( name -> Compare ( " " , L" " , 16 ) == true ) uuid = true ; else if ( name -> Compare ( " " , L" " , 18 ) == true ) in_braces = true ; if ( uuid == false && in_braces == false ) return false ; if ( Target ( SQL_ORACLE , SQL_MYSQL , SQL_POSTGRESQL ) == true ) Token :: Change ( name , " " , L" " , 8 ) ; else if ( _target != SQL_SQL_SERVER && in_braces == true ) Token :: ChangeNoFormat ( name , name , 1 , name -> len - 2 ) ; STATS_ITM_DECL DTYPE_STATS ( name ) DTYPE_DTL_STATS_0 ( name ) return true ; }
UNIQUEIDENTIFIER in SQL Server, Sybase ASA
UNIQUEIDENTIFIER in SQL Server Sybase ASA
// In SQL Server, UNIQUEIDENTIFIER is stored in 16 bytes, but on retrieval returns 36 characters (GUID with dashes) // Can be enclosed in [] for SQL Server // Convert to CHAR(36) in Oracle, MySQL, PostgreSQL // Remove [] for other databases