public static SqlStatement Open(PlSqlParser.OpenStatementContext context) { var cursorName = Name.Simple(context.cursor_name()); SqlExpression[] args = null; if (context.expression_list() != null) { args = context.expression_list().expression().Select(Expression.Build).ToArray(); } return new OpenStatement(cursorName, args); }
public static SqlStatement Declare(PlSqlParser.CursorDeclarationContext context) { var cursorName = Name.Simple(context.cursor_name()); var query = Subquery.Form(context.subquery()); CursorParameter[] parameters = null; if (context.parameterSpec() != null) { parameters = context.parameterSpec().Select(Parameter.Form).ToArray(); } return new DeclareCursorStatement(cursorName, parameters, query); }
public static SqlStatement Close(PlSqlParser.CloseStatementContext context) { var cursorName = Name.Simple(context.cursor_name()); return new CloseStatement(cursorName); }