SalSqlBindVariables
Namespace: PPJ.Runtime.Sql
Assembly: PPJ.Runtime.50 (5.0.0.0)
Parses and evaluates SQL bind expressions and INTO assignment targets.
- C#
- VB.NET
public class SalSqlBindVariables
Public Class SalSqlBindVariables
Set Context to the object that exposes expression values. Evaluation scopes cache root references until LeaveScope is called.
Example:
using PPJ.Runtime.Sql;
var bindings = new SalSqlBindVariables();
bindings.Context = new { CustomerId = 42 };
bindings.ParseBinds(":CustomerId");
object[] values = bindings.ReadBindValues();
Constructors
SalSqlBindVariables()
Initializes empty bind and INTO collections and the configured script parser.
Properties
Context
Object: Gets or sets the object used to resolve bind expressions.
DefaultParserType
Type: Gets or sets the parser type instantiated by new bind collections; null selects the C# parser.
ParsedIntos
BindVar[]: Gets the parsed INTO targets used to receive result columns.
ParsedVars
BindVar[]: Gets the parsed input and input/output bind expressions.
Methods
Clear()
Removes parsed expressions and resets the script environment.
LeaveScope()
Ends the current expression evaluation scope and releases its cached references.
NewScope()
Begins an expression evaluation scope that caches root object references.
ParseBinds(vars)
Parses a list of SAL bind expressions and replaces the parsed bindings.
| Parameter | Type | Description |
|---|---|---|
| vars | String | The comma-separated colon-prefixed expressions to parse, such as ":customerId, :customerName". |
Returns: Int32. The total number of parsed bind expressions and INTO targets.
ReadBindValues()
Evaluates all parsed bind expressions within a temporary scope.
Returns: Object[]. The bind values in parameter order, or an empty array when no binds are present.