sqlparser/language.cpp
// Data type casting operator :: in Informix, PostgreSQL 
Data type casting operator :: in Informix, PostgreSQL
Data type casting operator :: in Informix PostgreSQL
bool SqlParser::ParseCastOperator(Token *first)
{
	if(first == NULL)
		return false;
	Token *colon1 = GetNext(':', L':');
	Token *colon2 = GetNext(colon1, ':', L':');
	if(colon1 == NULL || colon2 == NULL)
		return false;
	Token *datatype = GetNext();
	ParseDataType(datatype, SQL_SCOPE_CAST_FUNC);
	Token *end = GetLastToken();
	if(Target(SQL_ORACLE, SQL_SQL_SERVER) == true)
	{
		Prepend(first, "CAST(", L"CAST(", 5, datatype);
		Token::Change(colon1, " AS ", L" AS ", 4, datatype);
		Token::Remove(colon2);
		AppendNoFormat(end, ")", L")", 1);
	}
	return true;
}
bool SqlParser :: ParseCastOperator ( Token * first ) { if ( first == NULL ) return false ; Token * colon1 = GetNext ( ' ' , L' ' ) ; Token * colon2 = GetNext ( colon1 , ' ' , L' ' ) ; if ( colon1 == NULL || colon2 == NULL ) return false ; Token * datatype = GetNext ( ) ; ParseDataType ( datatype , SQL_SCOPE_CAST_FUNC ) ; Token * end = GetLastToken ( ) ; if ( Target ( SQL_ORACLE , SQL_SQL_SERVER ) == true ) { Prepend ( first , " " , L" " , 5 , datatype ) ; Token :: Change ( colon1 , " " , L" " , 4 , datatype ) ; Token :: Remove ( colon2 ) ; AppendNoFormat ( end , " " , L" " , 1 ) ; } return true ; }
Data type casting operator :: in Informix, PostgreSQL
Data type casting operator :: in Informix PostgreSQL
// Use CAST(exp AS datatype) in Oracle, SQL Server