sqlparser/language.cpp
// Convert declared local temporary table (Sybase ASA), table variable (SQL Server) 
Convert declared local temporary table (Sybase ASA), table variable (SQL Server)
Convert declared local temporary table ( Sybase ASA ) table variable ( SQL Server )
bool SqlParser::ConvertTableVariable(Token *token)
{
	if(token == NULL)
		return false;
	bool exists = false;
	ListwItem *item = _spl_declared_local_tables.GetFirst();
	while(item != NULL)
	{
		Token *table = (Token*)item->value;
		if(table != NULL && Token::Compare(table, token) == true)
		{
			if(table->IsTargetSet() == true)
				Token::Change(token, table);	
			exists = true;
			break;
		}
		item = item->next;
	}
	return exists;
}
bool SqlParser :: ConvertTableVariable ( Token * token ) { if ( token == NULL ) return false ; bool exists = false ; ListwItem * item = _spl_declared_local_tables . GetFirst ( ) ; while ( item != NULL ) { Token * table = ( Token * ) item -> value ; if ( table != NULL && Token :: Compare ( table , token ) == true ) { if ( table -> IsTargetSet ( ) == true ) Token :: Change ( token , table ) ; exists = true ; break ; } item = item -> next ; } return exists ; }
Convert declared local temporary table (Sybase ASA), table variable (SQL Server)
Convert declared local temporary table ( Sybase ASA ) table variable ( SQL Server )
// Compare identifier with existing declared local table (table variable) // If the variable was changed, set new name to all references