PostgreSQL · Types · Procedures and functions
ArxProcedureExpression
Definition
- Namespace
ARX.SDK.Query- Package
ARX.SDK
public sealed class ArxProcedureExpressionA call to a routine the database owns: a stored procedure or a function, with its parameters, in the pattern of ArxQueryExpression. Never SQL text.
Constructor
ArxProcedureExpression()A call with no routine yet: set ProcedureName.
ArxProcedureExpression(string procedureName)A call to this procedure; set ProcedureType to call a function.
Parameter Type Description procedureNamestringThe routine, or schema.routine.
Properties
string ProcedureName { get; set; }The routine's name, optionally schema-qualified (
reporting.sp_close_month). Validated by the provider.ArxProcedureType ProcedureType { get; set; }Procedure (the default) or function.
List<ArxProcedureParameter> Parameters { get; set; }The parameters, in the order they are passed.
bool ReturnsCursors { get; set; }A function that returns
refcursororSETOF refcursor: each cursor is read as a result set. A procedure declares its cursors as parameters instead.List<ArxOrderExpression> Orders { get; set; }The order of a function's rows when ARX pages them (way 2). Not for procedures.
ArxPagingInfo? PageInfo { get; set; }The page to return: of a function's rows, of a cursor, or through the routine's own paging arguments (
PagingParameters).ArxPagingParameters? PagingParameters { get; set; }The routine pages itself: ARX fills these arguments from
PageInfo(way 1).string? PagedResultSet { get; set; }Which result set
PageInfopages when there are several cursors: a cursor parameter's name. The first by default.
Methods
void AddParameter(string name, object? value)A named IN argument.
Parameter Type Description namestringThe routine's parameter name, as the database declares it. valueobject?The value, sent as a parameter; null for SQL NULL. void AddParameter(object? value)A positional IN argument (positional arguments come before named ones).
Parameter Type Description valueobject?The value, sent as a parameter; null for SQL NULL. void AddParameter(string name, Type type, object? value)A named IN argument with its type, for a null the database can't type by itself (an overloaded routine).
Parameter Type Description namestringThe routine's parameter name, as the database declares it. typeTypeThe parameter's .NET type, so a null is sent with the right database type. valueobject?The value, sent as a parameter; null for SQL NULL. void AddOutParameter<T>(string name)An OUT parameter of a procedure, read into
Outputs[name]asT.Parameter Type Description namestringThe routine's OUT parameter name; its value is read back into the result's Outputs.void AddOutParameter(string name, Type type)An OUT parameter of a procedure, read into
Outputs[name]astype.Parameter Type Description namestringThe routine's OUT parameter name; its value is read back into the result's Outputs.typeTypeThe .NET type the value is read as. void AddInOutParameter<T>(string name, T value)An INOUT parameter:
valuegoes in, the procedure's value is read intoOutputs[name].Parameter Type Description namestringThe routine's INOUT parameter name; the value it ends with is read back. valueTThe value sent in. void AddCursorParameter(string name)A table the procedure returns, through an
INOUT refcursorparameter: read intoResultSets[name].Parameter Type Description namestringThe parameter through which the procedure returns a table (a refcursor on PostgreSQL), read as a result set. void AddVariadicParameter(string name, Array values)An array passed to a named
VARIADICparameter.Parameter Type Description namestringThe routine's VARIADIC parameter name. valuesArrayThe values, sent as one array. void AddVariadicParameter(Array values)An array passed to a positional
VARIADICparameter.Parameter Type Description valuesArrayThe values, sent as one array. void AddOrder(string attributeName, ArxOrderType orderType)Orders a function's rows (way 2).
Parameter Type Description attributeNamestringThe result column to order by. orderTypeArxOrderTypeAscending or Descending.
Usage
A line from a verified sample; the full, runnable code is on its page.
var procedure = new ArxProcedureExpression("sp_rename_account");Call a stored procedure, scenario 1
Used in:
- Call a stored procedureExecute
- Read OUT and INOUT valuesExecute
- Call a function: a value, rows, an effectExecute
- A procedure that returns tablesExecute
- Place an order through a procedureExecute
- A report with several result setsExecute
- Page through a procedure's result: the routine pages itself, ARX pages a function, ARX pages a cursorExecute
- Business errors raised by a procedureExecute
- A nightly job that commits in batchesExecute
- Progress messages from a procedureExecute
- Handle Execute errorsExecute
- Catch an SQL injection attempt on ExecuteExecute
- Execute in an ARX transactionExecute
- Execute in a batch scope: a refused call undone aloneExecute
- Export what a procedure returns, page by pageExecute
- A security check around Execute: probing, blocking, unblocking a false positiveExecute
- Execute on a preloaded, Strict schema: routines aren't covered, tables areExecute