DB Tasks

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

If your data processing requires substantial computing resources, (e.g. automated calculation of data from imported tabular files), we recommend using DB tasks to execute such stored procedures under the 'Ebs' database schema.

1 Add DB Tasks

To add a DB task:

  1. In FintechOS Studio, go to Main Menu > Advanced > DB Tasks.
  2. Click Insert.
  3. In the Add DB Task page, type a Name for the DB task. This is the name used by the system. You will need it when executing the DB task.
    IMPORTANT!  
    When naming your stored procedure in SQL, make sure to start the name with "ebs." to make the procedure visible later on in the DB Objects tab of Digital Assets page in Studio.
  4. 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 Save and reload and proceed to 2 Add Security Roles to DB Tasks. Otherwise, click Save and close.

IMPORTANT!  
If no security roles are added, any user is able to execute the DB task.

2 Add Security Roles to DB Tasks

If your business case requires that the DB tasks are executed only by users with 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.

After you finish adding the security roles, click Save and close to save the DB task updates.

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 executeDbTask function:

Syntax:

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

Request Parameters

Parameter

Type

Description
dbTaskName

string

The name of the DB Task registered in FintechOS Studio.
parameters

any

JSON object containing key-value pairs matching the names and values of the database stored procedure's input parameters.

Returns

The function returns an array of objects mapped to the columns from the result set of the stored procedure.

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