sqlparser/informix.cpp
// Various SET options such as SET ISOLATION ...
Various SET options such as SET ISOLATION
Various SET options such as SET ISOLATION
bool SqlParser::ParseInformixSetOptions(Token *set)
{
	if(set == NULL)
		return false;
	bool exists = false;
	bool comment = false;
	Token *next = GetNextToken();
	if(next == NULL)
		return false;
	if(next->Compare("ISOLATION", L"ISOLATION", 9) == true)
	{
		Token *to = GetNextWordToken("TO", L"TO", 2);
		Token *dirty = GetNextWordToken(to, "DIRTY", L"DIRTY", 5);
		Token *read = NULL;
		if(dirty != NULL)
			read = GetNextWordToken("READ", L"READ", 4);
		if(read != NULL && _target == SQL_ORACLE)
			comment = true;
		exists = true;
	}
	else
	if(next->Compare("EXPLAIN", L"EXPLAIN", 7) == true)
	{
		Token *file = GetNextWordToken("FILE", L"FILE", 4);
		Token *to = GetNextWordToken(file, "TO", L"TO", 2);
		Token *name = GetNextToken(to);
		Token *with = GetNextWordToken(name, "WITH", L"WITH", 4);
		 (void) GetNextWordToken(with, "APPEND", L"APPEND", 6);
		if(name != NULL && _target == SQL_ORACLE)
			comment = true;
		exists = true;
	}
	if(exists == true && comment == true)
	{
		Token *semi = GetNextCharToken(';', L';');
		Comment(set, Nvl(semi, GetLastToken()));
	}
	return exists;
}
bool SqlParser :: ParseInformixSetOptions ( Token * set ) { if ( set == NULL ) return false ; bool exists = false ; bool comment = false ; Token * next = GetNextToken ( ) ; if ( next == NULL ) return false ; if ( next -> Compare ( " " , L" " , 9 ) == true ) { Token * to = GetNextWordToken ( " " , L" " , 2 ) ; Token * dirty = GetNextWordToken ( to , " " , L" " , 5 ) ; Token * read = NULL ; if ( dirty != NULL ) read = GetNextWordToken ( " " , L" " , 4 ) ; if ( read != NULL && _target == SQL_ORACLE ) comment = true ; exists = true ; } else if ( next -> Compare ( " " , L" " , 7 ) == true ) { Token * file = GetNextWordToken ( " " , L" " , 4 ) ; Token * to = GetNextWordToken ( file , " " , L" " , 2 ) ; Token * name = GetNextToken ( to ) ; Token * with = GetNextWordToken ( name , " " , L" " , 4 ) ; ( void ) GetNextWordToken ( with , " " , L" " , 6 ) ; if ( name != NULL && _target == SQL_ORACLE ) comment = true ; exists = true ; } if ( exists == true && comment == true ) { Token * semi = GetNextCharToken ( ' ' , L' ' ) ; Comment ( set , Nvl ( semi , GetLastToken ( ) ) ) ; } return exists ; }
Various SET options such as SET ISOLATION ...
Various SET options such as SET ISOLATION ...
// SET ISOLATION TO DIRTY READ // Comment for Oracle // SET EXPLAIN FILE TO 'file' // File name // Optional WITH APPEND /*Token *append */ // Comment for Oracle // Check if the statement needs to be commented