Using Array Functions

Overview

Oracle CPQ declares, initializes, populates, and manipulates arrays using BML. Refer to Array Functions for details about available functions.

An array is an ordered collection of values, referenced by a single variable name. Think of an array as a table, with values in rows and columns. Another way to think of arrays is in relation to an x-y axis. If you recall, data sets are formatted as (x, y). Data in arrays is similar:

(row, column)
(x, y)
("color", "shape")

Array Attributes

Before You Begin:

Here is some general information regarding arrays that you should know before you get started. Another way to think of an array is as a 1-D or 2-D table.

BML Array Syntax

Element Meaning

[]

Indicates a 1-D array

[] []

Indicates a 2-D array

[n]

1-D array with a defined size

[n][n]

2-D array with a defined size

{x, y}

Elements within a 1-D array

{(x, y), (z,r)}

Elements within a 2-D array

Indexes

Populating Arrays

Examples of how to populate 1-D and 2-D arrays using a for...loop.

Uninitialized Arrays

In order to show you the different ways to declare arrays, we will display two separate arrays below. myArray will show you what to expect if you define an array size without initializing array fields. yourArray will show you what is returned when you define the size of an array as well as initialize the fields.

Example of Uninitialized Arrays

Uninitialized Array example

As you can see, myArray returned a string with four null values because array fields were not initialized after the array was declared.

Uninitialized Array concole

 

Notes

  • NULL and blank Integer values are treated as separate values:
    • NULL= 0
    • Blank = ""
  • Using NULL as an attribute value is strongly discouraged.
  • If you use logic that tests for NULL values in rule conditions or BML, confirm that the logic takes this difference into account.

BML size limits have default settings. The default row size is 5000. The default column size is 50.
To increase the default row and column size, open a ticket on My Oracle Support.

Related Topics

Related Topics Link IconSee Also