sqlparser/statements.cpp
// DB2 for z/OS CREATE STOGROUP
DB2 for z/OS CREATE STOGROUP
DB2 for z / OS CREATE STOGROUP
bool SqlParser::ParseCreateStogroup(Token *create, Token *stogroup)
{
	if(create == NULL || stogroup == NULL)
		return false;
	STATS_DECL
    STMS_STATS_V("CREATE STOGROUP", create);
	Token *name = GetNextIdentToken();
	if(name == NULL)
		return false;
	bool exists = false;
	while(true)
	{
		Token *next = GetNextToken();
		if(next == NULL)
			break;
		if(next->Compare("VOLUMES", L"VOLUMES", 7) == true)
		{
			Token *open = GetNextCharToken('(', L'(');
			while(true)
			{
				if(open == NULL)
					break;
				Token *name = GetNextToken();
				if(name == NULL)
					break;
				Token *comma = GetNextCharToken(',', L',');
				if(comma == NULL)
					break;
			}
			 (void) GetNextCharToken(')', L')');
			exists = true;
			continue;
		}
		else
		if(next->Compare("VCAT", L"VCAT", 4) == true)
		{
			 (void) GetNextToken();
			exists = true;
			continue;
		}
		PushBack(next);
		break;
	}
	if(_target != SQL_DB2)
	{
		Token *end = GetLastToken(GetNextCharToken(';', L';'));
		Comment(create, end);
	}
	return true;
}
bool SqlParser :: ParseCreateStogroup ( Token * create , Token * stogroup ) { if ( create == NULL || stogroup == NULL ) return false ; STATS_DECL STMS_STATS_V ( " " , create ) ; Token * name = GetNextIdentToken ( ) ; if ( name == NULL ) return false ; bool exists = false ; while ( true ) { Token * next = GetNextToken ( ) ; if ( next == NULL ) break ; if ( next -> Compare ( " " , L" " , 7 ) == true ) { Token * open = GetNextCharToken ( ' ' , L' ' ) ; while ( true ) { if ( open == NULL ) break ; Token * name = GetNextToken ( ) ; if ( name == NULL ) break ; Token * comma = GetNextCharToken ( ' ' , L' ' ) ; if ( comma == NULL ) break ; } ( void ) GetNextCharToken ( ' ' , L' ' ) ; exists = true ; continue ; } else if ( next -> Compare ( " " , L" " , 4 ) == true ) { ( void ) GetNextToken ( ) ; exists = true ; continue ; } PushBack ( next ) ; break ; } if ( _target != SQL_DB2 ) { Token * end = GetLastToken ( GetNextCharToken ( ' ' , L' ' ) ) ; Comment ( create , end ) ; } return true ; }
DB2 for z/OS CREATE STOGROUP
DB2 for z / OS CREATE STOGROUP
// Options // VOLUMES (v1, ...) // Comma separated list // Identifier or '*'  /*Token *close */ // VCAT name /*Token *name */ // Comment the entire statement for other databases