sqlparser/statements.cpp
// LEAVE statement in DB2, Sybase ADS
LEAVE statement in DB2, Sybase ADS
LEAVE statement in DB2 Sybase ADS
bool SqlParser::ParseLeaveStatement(Token *leave)
{
	if(leave == NULL)
		return false;
    STATS_DECL
	PL_STMS_STATS(leave);
	Token *label = GetNextToken();
	if(TOKEN_CMPC(label, ';'))
	{
		PushBack(label);
		label = NULL;
	}
	if(_target == SQL_ORACLE)
	{
		if(Token::Compare(_spl_outer_label, label) == true)
		{
			Token::Change(leave, "RETURN", L"RETURN", 6);
			Token::Remove(label);
		}
		else
			Token::Change(leave, "EXIT", L"EXIT", 4);
	}
	else
	if(_target == SQL_SQL_SERVER && label == NULL)
		TOKEN_CHANGE(leave, "BREAK");
	return true;
}
bool SqlParser :: ParseLeaveStatement ( Token * leave ) { if ( leave == NULL ) return false ; STATS_DECL PL_STMS_STATS ( leave ) ; Token * label = GetNextToken ( ) ; if ( TOKEN_CMPC ( label , ' ' ) ) { PushBack ( label ) ; label = NULL ; } if ( _target == SQL_ORACLE ) { if ( Token :: Compare ( _spl_outer_label , label ) == true ) { Token :: Change ( leave , " " , L" " , 6 ) ; Token :: Remove ( label ) ; } else Token :: Change ( leave , " " , L" " , 4 ) ; } else if ( _target == SQL_SQL_SERVER && label == NULL ) TOKEN_CHANGE ( leave , " " ) ; return true ; }
LEAVE statement in DB2, Sybase ADS
LEAVE statement in DB2 Sybase ADS
// Mandatory label name in DB2; no label in Sybase ADS // EXIT label or RETURN in Oracle // Use RETURN from procedure if it is the outer procedure block label