public final class SqlValue extends Object
DataFlowAnalyzer.resolveDynamicSqlLineage.
This is the input side of dynamic-SQL resolution: the caller knows
the value a parameter actually had at a call site (e.g. @SourceDB='QSP')
and passes it in. It is intentionally simple — a string, a number, or SQL
NULL. The evaluator widens these into the internal
SqlStringValue lattice (which also models partial and
unknown states that a caller can never supply).
NULL is represented explicitly (not as a Java null binding) so the
evaluator can honor T-SQL NULL-propagation semantics
(VARCHAR + NULL -> NULL). A Java null key/value in the bindings
map is treated as "no binding for this parameter".
| Modifier and Type | Method and Description |
|---|---|
Double |
asNumber()
The numeric value, or null when this is not a number binding.
|
String |
asText()
The string form of the value (null only when
isNull()). |
boolean |
isNull() |
boolean |
isNumber() |
boolean |
isSuppliedUnknown()
True for
suppliedUnknown(java.lang.String). |
static SqlValue |
nullValue()
An explicit SQL NULL binding.
|
static SqlValue |
of(BigDecimal value)
An exact number, its text kept as written (Mantis 4962):
100000000000000000000 or a DECIMAL with many
digits, which a double would round. |
static SqlValue |
of(boolean value)
A boolean binding, mapped to T-SQL BIT semantics (1/0).
|
static SqlValue |
of(double value)
A floating-point binding.
|
static SqlValue |
of(long value)
An integer binding, e.g.
|
static SqlValue |
of(String value)
A string binding, e.g.
|
static SqlValue |
suppliedUnknown(String reason)
A value a caller passes that nobody knows (Mantis 4962): the parameter is bound, so its declared default does
not apply, but its value is unknown and the evaluation keeps it as a placeholder with
reason. |
String |
toString() |
String |
unknownReason()
Why a
suppliedUnknown(java.lang.String) value is not known; null for any other value. |
public static SqlValue suppliedUnknown(String reason)
reason.public boolean isSuppliedUnknown()
suppliedUnknown(java.lang.String).public String unknownReason()
suppliedUnknown(java.lang.String) value is not known; null for any other value.public static SqlValue of(long value)
@Debug = 0. Used for decidable IF and concatenation.public static SqlValue of(BigDecimal value)
100000000000000000000 or a DECIMAL with many
digits, which a double would round. The double it also carries is only for comparisons that read one.public boolean isNull()
public boolean isNumber()