#include <sp_pcontext.h>
The class represents parse-time context, which keeps track of declared variables/parameters, conditions, handlers, cursors and labels.
sp_context objects are organized in a tree according to the following rules:
sp_pcontext objects are used both at parse-time and at runtime.
During the parsing stage sp_pcontext objects are used:
During the runtime phase, a tree of sp_pcontext objects is used:
Add SP-variable to the parsing context.
This is an auxilary parsing-time function to check if an SQL-handler exists in the current parsing context (current scope) for the given SQL-condition. This function is used to check for duplicates during the parsing phase.
This function can not be used during the runtime phase to check SQL-handler existence because it searches for the SQL-handler in the current scope only (during runtime, current and parent scopes should be checked according to the SQL-handler resolution rules).
Set the current scope boundary (for default values).
Calculate and return the number of cursors to pop between the given context and this one.
Calculate and return the number of handlers to pop between the given context and this one.
Find an SQL handler for the given SQL condition according to the SQL-handler resolution rules. This function is used at runtime.
Find SP-variable by name.
The function does a linear search (from newer to older variables, in case we have shadowed names).
The function is called only at parsing time.
Find SP-variable by the offset in the root parsing context.
The function is used for two things:
Pop a node from the parsing context tree.
Create and push a new context in the tree.
Retrieve full type information about SP-variables in this parsing context and its children.