sqlparser/functions.cpp
// LENGTH in Oracle, DB2, Informix, Sybase ASA
LENGTH in Oracle, DB2, Informix, Sybase ASA
LENGTH in Oracle DB2 Informix Sybase ASA
bool SqlParser::ParseFunctionLength(Token *name, Token* )
{
	if(name == NULL)
		return false;
	STATS_DECL
    STATS_SET_DESC(SQL_FUNC_LENGTH_DESC)
	Token *string = GetNextToken();
	if(string == NULL)
		return false;
	ParseExpression(string);
	 (void) GetNextCharToken(')', L')');
	if(_target == SQL_SQL_SERVER)
		Token::Change(name, "LEN", L"LEN", 3);
	else
	if(Target(SQL_MARIADB, SQL_MYSQL))
		Token::Change(name, "CHAR_LENGTH", L"CHAR_LENGTH", 11);
	FUNC_STATS(name);
	return true;
}
bool SqlParser :: ParseFunctionLength ( Token * name , Token * ) { if ( name == NULL ) return false ; STATS_DECL STATS_SET_DESC ( SQL_FUNC_LENGTH_DESC ) Token * string = GetNextToken ( ) ; if ( string == NULL ) return false ; ParseExpression ( string ) ; ( void ) GetNextCharToken ( ' ' , L' ' ) ; if ( _target == SQL_SQL_SERVER ) Token :: Change ( name , " " , L" " , 3 ) ; else if ( Target ( SQL_MARIADB , SQL_MYSQL ) ) Token :: Change ( name , " " , L" " , 11 ) ; FUNC_STATS ( name ) ; return true ; }
LENGTH in Oracle, DB2, Informix, Sybase ASA
LENGTH in Oracle DB2 Informix Sybase ASA
/*open*/ // Parse string /*Token *close */ // Convert to LEN in SQL Server // Convert to CHAR_LENGTH in MySQL