25 if (context.CursorExists(cursorInfo.
CursorName))
26 throw new InvalidOperationException(String.Format(
"A cursor named '{0}' was already defined in the context.",
29 var currentContext = context;
30 while (currentContext != null) {
32 var scope = (ICursorScope)currentContext;
33 scope.DeclareCursor(cursorInfo);
37 currentContext = currentContext.
Parent;
44 DeclareCursor(context, cursorName, (
CursorFlags)0, query);
48 context.DeclareCursor(
new CursorInfo(cursorName, flags, query));
52 DeclareInsensitiveCursor(context, cursorName, query,
false);
60 context.DeclareCursor(cursorName, flags, query);
65 var currentContext = context;
66 while (currentContext != null) {
68 var scope = (ICursorScope) currentContext;
69 if (scope.CursorExists(cursorName))
73 currentContext = currentContext.
Parent;
80 var currentContext = context;
81 while (currentContext != null) {
83 var scope = (ICursorScope)currentContext;
84 var cursor = scope.GetCursor(cursorName);
89 currentContext = currentContext.
Parent;
96 var currentContext = context;
97 while (currentContext != null) {
99 var scope = (ICursorScope)currentContext;
100 if (scope.CursorExists(cursorName))
101 return scope.DropCursor(cursorName);
104 currentContext = currentContext.
Parent;
111 var cursor = context.FindCursor(cursorName);
120 var cursor = context.FindCursor(cursorName);
125 throw new NotImplementedException();
static void DeclareInsensitiveCursor(this IContext context, string cursorName, SqlQueryExpression query)
static void DeclareCursor(this IContext context, string cursorName, CursorFlags flags, SqlQueryExpression query)
static bool CloseCursor(this IContext context, string cursorName)
static bool DeclareCursor(this IContext context, CursorInfo cursorInfo)
static void DeclareInsensitiveCursor(this IContext context, string cursorName, SqlQueryExpression query, bool withScroll)
static Cursor FindCursor(this IContext context, string cursorName)
static void DeclareCursor(this IContext context, string cursorName, SqlQueryExpression query)
static bool DropCursor(this IContext context, string cursorName)
static bool CursorExists(this IContext context, string cursorName)
static bool OpenCursor(this IContext context, IRequest request, string cursorName, params SqlExpression[] args)
Defines the base class for instances that represent SQL expression tree nodes.