sqlparser/functions.cpp
// DATETIME in Informix and Sybase ASA
DATETIME in Informix and Sybase ASA
DATETIME in Informix and Sybase ASA
bool SqlParser::ParseFunctionDatetime(Token *name, Token *open)
{
	if(name == NULL)
		return false;
	STATS_DECL
	if(_source == SQL_INFORMIX)
		return ParseFunctionDatetimeInformix(name, open);
	Token *exp = GetNextToken();
	if(exp == NULL)
		return false;
	ParseExpression(exp);
	 (void) GetNextCharToken(')', L')');
	if(_target == SQL_ORACLE)
		Token::Change(name, "TO_TIMESTAMP", L"TO_TIMESTAMP", 12);
	else
	if(_target == SQL_SQL_SERVER)
	{
		Token::Change(name, "CONVERT", L"CONVERT", 7);
		Append(open, "DATETIME, ", L"DATETIME, ", 10, name);
	}
	FUNC_STATS(name);
	return true;
}
bool SqlParser :: ParseFunctionDatetime ( Token * name , Token * open ) { if ( name == NULL ) return false ; STATS_DECL if ( _source == SQL_INFORMIX ) return ParseFunctionDatetimeInformix ( name , open ) ; Token * exp = GetNextToken ( ) ; if ( exp == NULL ) return false ; ParseExpression ( exp ) ; ( void ) GetNextCharToken ( ' ' , L' ' ) ; if ( _target == SQL_ORACLE ) Token :: Change ( name , " " , L" " , 12 ) ; else if ( _target == SQL_SQL_SERVER ) { Token :: Change ( name , " " , L" " , 7 ) ; Append ( open , " " , L" " , 10 , name ) ; } FUNC_STATS ( name ) ; return true ; }
DATETIME in Informix and Sybase ASA
DATETIME in Informix and Sybase ASA
// DATETIME (literal) field qualifier in Informix // Parse expression /*Token *close */ // Convert to TO_TIMESTAMP in Oracle // CONVERT(DATETIME, exp) in SQL Server