Package dev.frostlake.executor
Class AnonymousBlockResult
java.lang.Object
dev.frostlake.executor.AnonymousBlockResult
The one-row result an anonymous block answers when it runs as a statement — directly, or as the text
of an EXECUTE IMMEDIATE: a single column named
anonymous block holding the value its RETURN
produced, or NULL typed VARCHAR when the block ran to its end without a RETURN. A CALL answers the
same shape with the column named after its procedure, and a RETURN TABLE answers its table instead.-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic DataTypecolumnType(DataType type) The type the result column declares for a value oftype: a text at VARCHAR's full width and a binary at BINARY's, whatever width was written (live-verified: a VARCHAR(10) reads VARCHAR(16777216) and a BINARY(10) BINARY(8388608)); any other type as it is.static booleanisBlock(FrostlakeParser.StatementContext statement) Whether a statement is an anonymous block —[DECLARE …] BEGIN … END— in its own right.static ResultSetThe result of a block whose RETURN producedvalue.static ResultSetThe result of a block that ran to its end without a RETURN.
-
Field Details
-
COLUMN
The name Snowflake gives the one column of an anonymous block's result.- See Also:
-
-
Method Details
-
of
The result of a block whose RETURN producedvalue.- Parameters:
value- the returned value, or nulltype- the type the result column declares- Returns:
- the single-row, single-column result
-
withoutReturn
The result of a block that ran to its end without a RETURN.- Returns:
- one row holding NULL, typed VARCHAR
-
columnType
The type the result column declares for a value oftype: a text at VARCHAR's full width and a binary at BINARY's, whatever width was written (live-verified: a VARCHAR(10) reads VARCHAR(16777216) and a BINARY(10) BINARY(8388608)); any other type as it is.- Parameters:
type- the value's type, or null- Returns:
- the column's type, or null when there is none
-
isBlock
Whether a statement is an anonymous block —[DECLARE …] BEGIN … END— in its own right.- Parameters:
statement- the statement's parse tree, or null- Returns:
- true for a block statement
-