public override SqlStatement VisitGrantRoleStatement(PlSqlParser.GrantRoleStatementContext context) { // TODO: this is also the point in which is possible to set the system privileges to a user var grantee = SqlParseUtil.Name.Simple(context.granteeName()); var roleNames = context.roleName().Select(SqlParseUtil.Name.Simple).ToArray(); foreach (var roleName in roleNames) { AddStatement(context, new GrantRoleStatement(grantee, roleName)); } return(base.VisitGrantRoleStatement(context)); }
public override SqlStatement VisitGrantRoleStatement(PlSqlParser.GrantRoleStatementContext context) { var grantee = Name.Simple(context.granteeName()); var roleNames = context.roleName().Select(Name.Simple).ToArray(); if (roleNames.Length == 1) { return(new GrantRoleStatement(grantee, roleNames[0])); } var seq = new SequenceOfStatements(); foreach (var roleName in roleNames) { seq.Statements.Add(new GrantRoleStatement(grantee, roleName)); } return(seq); }