sqlparser/language.cpp
// Check for local temporary table column reference (Sybase ASA)
Check for local temporary table column reference (Sybase ASA)
Check for local temporary table column reference ( Sybase ASA )
bool SqlParser::ConvertLocalTableColumn(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, table->len) == true && 
			token->Compare(".", L".", table->len, 1) == true)
		{
			if(table->IsTargetSet() == true)
			{
				TokenStr ident(table);
				ident.Append(token, table->len, token->len - table->len);
				Token::ChangeNoFormat(token, ident);
			}
			exists = true;
			break;
		}
		item = item->next;
	}
	return exists;
}
bool SqlParser :: ConvertLocalTableColumn ( 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 , table -> len ) == true && token -> Compare ( " " , L" " , table -> len , 1 ) == true ) { if ( table -> IsTargetSet ( ) == true ) { TokenStr ident ( table ) ; ident . Append ( token , table -> len , token -> len - table -> len ) ; Token :: ChangeNoFormat ( token , ident ) ; } exists = true ; break ; } item = item -> next ; } return exists ; }
Check for local temporary table column reference (Sybase ASA)
Check for local temporary table column reference ( Sybase ASA )
// Compare identifier prefix with existing local temporary name // Check for table. prefix // If the table variable was changed, set new name to all references // Append referenced column name