sqlparser/sqlserver.cpp
// Add statement delimiter if not set when source is SQL Server, Sybase ASE
Add statement delimiter if not set when source is SQL Server, Sybase ASE
Add statement delimiter if not set when source is SQL Server Sybase ASE
void SqlParser::SqlServerAddStmtDelimiter(bool force)
{
	if(Source(SQL_SQL_SERVER, SQL_SYBASE) == false || TOKEN_CMPC(GetLastToken(), ';'))
		return;
	if(_spl_scope == 0 && force == false)
	{
		if(!LookNext("GO", L"GO", 2))
			return;
	}
	Token *semi = GetNextCharToken(';', L';');
	if(semi != NULL)
	{
		PushBack(semi);
		return;
	}
	Token *comma = GetNextCharToken(',', L',');
	if(comma != NULL)
	{
		PushBack(comma);
		return;
	}
	AppendNoFormat(GetLastToken(), ";", L";", 1);
}
void SqlParser :: SqlServerAddStmtDelimiter ( bool force ) { if ( Source ( SQL_SQL_SERVER , SQL_SYBASE ) == false || TOKEN_CMPC ( GetLastToken ( ) , ' ' ) ) return ; if ( _spl_scope == 0 && force == false ) { if ( ! LookNext ( " " , L" " , 2 ) ) return ; } Token * semi = GetNextCharToken ( ' ' , L' ' ) ; if ( semi != NULL ) { PushBack ( semi ) ; return ; } Token * comma = GetNextCharToken ( ' ' , L' ' ) ; if ( comma != NULL ) { PushBack ( comma ) ; return ; } AppendNoFormat ( GetLastToken ( ) , " " , L" " , 1 ) ; }
Add statement delimiter if not set when source is SQL Server, Sybase ASE
Add statement delimiter if not set when source is SQL Server Sybase ASE
// Add the delimiter in statements in procedural block only // Special case when a single statement followed by GO, then add ; even if we are no inside procedure scope // Check if the delimiter already set // Do not set if comma followed