DB Tasks

A stored procedure is a set of Structured Query Language (SQL) statements which are saved in the database (DB).

If the stored procedures are performing massive computing, (e.g. automated calculation of data from imported tabular files), for high-performance computing, we recommend you to use DB tasks to execute such stored procedures under the 'Ebs' DB schema.

Step 1. Add DB tasks

To add a DB task:

  1. Log in the FintechOS Studio using developer mode.
  2. Click the Main Menu, then click Advanced > DB Tasks. The DB Tasks List page appears.
  3. At the top-right corner of the page, click the Insert icon. The Add DB Task page appears.
  4. Type a Name for the DB task. It is the name used by the system. You need it when executing the DB task.
  5. In the Statement field, type the name of the stored SQL procedure.

If you want to add security roles to DB tasks, at the top right corner of the page, click the Save and reload icon. and go to STEP 2; otherwise, click the Save and close icon.

Step 2. Add security roles to DB tasks

If your business case requires that the DB tasks are executed only by designated roles within your organization, in the Edit DB Task page, click the Insert existing button at the top of the SECURITY ROLES section. A pop-up listing all defined security roles appears.

Double-click the desired security role from the list, The pup-up closes and the selected security role is displayed in the SECURITY ROLES section.

Add the security roles that comply with your organization's security policies.

NOTE   If no security roles are added, all users will be able to execute the DB task.

After you finish adding the security roles, at the top-right corner of the page, click the Save and close icon to save the DB task updates.

Step 3. Execute DB Tasks

Users who have a security role defined on a DB task can execute that DB task in server automation scripts by using the following Server SDK function:

Syntax:

Copy
function executeDbTask(dbTaskName: string, parameters: any): IExecuteDbTaskResult

Request Parameters

Parameter

Description

dbTaskName

The name of the DB task to be executed.

parameters

The array of parameters and their values specified in the stored procedure. It is a json object with the following format:

Copy
parameterObject = [
                     { paramName: "paramName", paramType: "ParamType", paramValue: "paramValue"}
                     ....
]

Returns

The function returns an array of objects mapped to the columns from select in the stored procedure.

NOTE  If the DB Task has no security roles associated, all users can execute the DB task.