wire.data.StoredProcedure

Parameter Class

Property

Type

Description

EventName

string

Parameter name alias used to map a parameter to another parameter or field in another query

Name

string

Parameter name

Value

string | number

Parameter value

Properties

Name

Type

Default

Description

Name

object

null

The name of the stored procedure in the data service.

Params

[ ]

null

An array of parameters for the stored procedure.

Methods

Name

Description

cast

Static method that casts an object with the same stored procedure properties into an instance of the StoredProcedure class.

eventName

Adds an event name to a parameter

getParam(param)

Returns the parameter object named param.

param(param, value)

Adds a value to a parameter using the chained method procedure.

If a service provider supports executing stored procedures, it will set the allow.storedProcedure attribute to true.

const allowSprocs = accountService.allow().storedProcedure;

The following creates a new StoredProcedure object which will call the stored procedure spGetUsers in the data service with a parameter User equal to apeters.

const proc = wire.data.procedure("spGetUsers")
    .param("User", "apeters");

The following gets the stored procedure parameter object UserName.

const param = proc.getParam("UserName");

The following is a TypeScript example that executes the stored procedure in the data service.

...

const dataTable = await accountService.execAsync(proc);

Visit Creating Queries - Stored Procedures for more details and examples.

Last updated