Tuesday, 28 September 2021

Describe the Evaluation of Parameters order and first_defined function-

Following is the order of evaluation:

- Host setup script will be executed first

- All Common parameters, that is, included, are evaluated

- All Sandbox parameters are evaluated

- The project script – project-start. ksh is executed

- All form parameters are evaluated

- Graph parameters are evaluated

- The End Script of the graph is executed


first_defined

Returns the first defined (non-NULL) value from among the input arguments. The input expressions must all be of the same or compatible types.

Syntax

object first_defined(expr [ , expr ... ] )

Usage - 

- > You must specify at least two expressions as arguments for this function.

- > This function is useful in assigning default values to input fields whose values are NULL. The function does the following:

- > Checks each input value to see if the value is defined.

- > Stops at the first defined value.

- > Returns the first defined value.

- > If all arguments evaluate NULL, this function returns NULL.

This function is equivalent to the  SQL function COALESCE and similar to the older Oracle function NVL.

Example 1

first_defined(expr1 = (decimal(3))1.1, expr2 = "jan", expr3 = "feb", expr4 = "mar")

(Types long and decimal are compatible in the preceding expression.) The function returns the following result:

"1.1"

Example 2 -

In this example, some of the function’s arguments are NULL:

first_defined(NULL, 42, NULL, 43)

The function returns the following result:

42

No comments:

Post a Comment

how to create dml dynamically in Ab-initio

 $[ begin let int i = 0; let string(int) complete_list = "emp_nm,billable,age,designation,location"; let string(int) file_content ...