public class PlsqlBlockScope extends AbstractScope
PL/SQL blocks can have labels (< This scope:
<<main>>
DECLARE
ename VARCHAR2(10) := 'KING';
BEGIN
DELETE FROM emp WHERE ename = main.ename; -- main.ename references the block variable
END;
node, parent, scopeType| Constructor and Description |
|---|
PlsqlBlockScope(IScope parent,
TBlockSqlNode blockNode)
Create a new PL/SQL block scope for a labeled block.
|
PlsqlBlockScope(IScope parent,
TCustomSqlStatement stmt,
String procedureName)
Create a new PL/SQL block scope for a stored procedure or function.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addChild(INamespace namespace,
String alias,
boolean nullable)
Default implementation: not supported (most scopes don't have children)
|
String |
getBlockLabel()
Get the block label.
|
TBlockSqlNode |
getBlockNode()
Get the block node.
|
List<ScopeChild> |
getChildren()
Default implementation: empty list
|
PlsqlVariableNamespace |
getVariableNamespace()
Get the variable namespace for this block.
|
List<INamespace> |
getVisibleNamespaces()
Default implementation: delegate to parent
|
void |
resolve(List<String> names,
INameMatcher matcher,
boolean deep,
IResolved resolved)
Default implementation: delegate to parent
|
INamespace |
resolveTable(String tableName)
Default implementation: delegate to parent
|
String |
toString() |
fullyQualify, getNode, getParent, getScopeType, isWithinpublic PlsqlBlockScope(IScope parent, TBlockSqlNode blockNode)
parent - The parent scopeblockNode - The block AST node (TBlockSqlNode)public PlsqlBlockScope(IScope parent, TCustomSqlStatement stmt, String procedureName)
parent - The parent scopestmt - The stored procedure/function statementprocedureName - The name of the procedure/function (used as the block label)public String getBlockLabel()
public PlsqlVariableNamespace getVariableNamespace()
public TBlockSqlNode getBlockNode()
public void addChild(INamespace namespace, String alias, boolean nullable)
AbstractScopeaddChild in interface IScopeaddChild in class AbstractScopenamespace - The namespace to addalias - The alias for this namespacenullable - Whether this namespace is nullable (e.g., RIGHT side of LEFT JOIN)public List<ScopeChild> getChildren()
AbstractScopegetChildren in interface IScopegetChildren in class AbstractScopepublic INamespace resolveTable(String tableName)
AbstractScoperesolveTable in interface IScoperesolveTable in class AbstractScopetableName - Table name or aliaspublic void resolve(List<String> names, INameMatcher matcher, boolean deep, IResolved resolved)
AbstractScoperesolve in interface IScoperesolve in class AbstractScopenames - Name parts (e.g., ["schema", "table", "column"])matcher - Name matcher for case sensitivity rulesdeep - Whether to recursively resolve into record fieldsresolved - Callback to collect all matchespublic List<INamespace> getVisibleNamespaces()
AbstractScopegetVisibleNamespaces in interface IScopegetVisibleNamespaces in class AbstractScopepublic String toString()
toString in class AbstractScope