sqlparser/functions.cpp
// CEIL in Oracle, DB2, MySQL, Sybase ASA
CEIL in Oracle, DB2, MySQL, Sybase ASA
CEIL in Oracle DB2 MySQL Sybase ASA
bool SqlParser::ParseFunctionCeil(Token *name, Token* )
{
	if(name == NULL)
		return false;
	STATS_DECL
	STATS_SET_DESC(SQL_FUNC_CEIL_DESC)
	Token *sign = GetNextCharToken('$', L'$');
	Token *num = GetNextToken();
	if(num == NULL)
		return false;
	ParseExpression(num);
	 (void) GetNextCharToken(')', L')');
	if(_target == SQL_ORACLE && sign != NULL)
		Token::Remove(sign);
	else
	if(_target == SQL_SQL_SERVER)
		Token::Change(name, "CEILING", L"CEILING", 7);
	STATS_SET_CONV_NO_NEED(Target(SQL_MARIADB, SQL_MARIADB_ORA))  
	FUNC_STATS(name);
	return true;
}
bool SqlParser :: ParseFunctionCeil ( Token * name , Token * ) { if ( name == NULL ) return false ; STATS_DECL STATS_SET_DESC ( SQL_FUNC_CEIL_DESC ) Token * sign = GetNextCharToken ( ' ' , L' ' ) ; Token * num = GetNextToken ( ) ; if ( num == NULL ) return false ; ParseExpression ( num ) ; ( void ) GetNextCharToken ( ' ' , L' ' ) ; if ( _target == SQL_ORACLE && sign != NULL ) Token :: Remove ( sign ) ; else if ( _target == SQL_SQL_SERVER ) Token :: Change ( name , " " , L" " , 7 ) ; STATS_SET_CONV_NO_NEED ( Target ( SQL_MARIADB , SQL_MARIADB_ORA ) ) FUNC_STATS ( name ) ; return true ; }
CEIL in Oracle, DB2, MySQL, Sybase ASA
CEIL in Oracle DB2 MySQL Sybase ASA
/*open*/ // Get dollar sign if exists // Parse num /*Token *close */ // Remove dollar sign for Oracle CEIL // Convert to CEILING in SQL Server