| Previous | Next |  | Contents | Index | Glossary

## SetItemAttributeArray

PL/SQL Syntax

`procedure SetItemAttrTextArray`

        (itemtype in varchar2,

         itemkey in varchar2,

         aname in Wf_Engine.NameTabTyp,

         avalue in Wf_Engine.TextTabTyp);

    procedure SetItemAttrNumberArray

        (itemtype in varchar2,

         itemkey in varchar2,

         aname in Wf_Engine.NameTabTyp,

         avalue in Wf_Engine.NumTabTyp);

    procedure SetItemAttrDateArray

        (itemtype in varchar2,

         itemkey in varchar2,

         aname in Wf_Engine.NameTabTyp,

         avalue in Wf_Engine.DateTabTyp);

Description

Sets the values of an array of item type attributes in a process. Use the SetItemAttributeArray APIs rather than the SetItemAttribute APIs for improved performance when you need to set the values of large numbers of item type attributes at once.

Use the correct procedure for your attribute type. All attribute types except number and date use SetItemAttrTextArray.

> Note: The SetItemAttributeArray APIs use the following PL/SQL table composite datatypes defined in the WF_ENGINE package:

PL/SQL Table Type | Column Datatype Definition
--- | ---
NameTabTyp | Wf_Item_Attribute_Values.NAME%TYPE
TextTabTyp | Wf_Item_Attribute_Values.TEXT_VALUE%TYPE
NumTabTyp | Wf_Item_Attribute_Values.NUMBER_VALUE%TYPE
DateTabTyp | Wf_Item_Attribute_Values.DATE_VALUE%TYPE

Arguments (input) | itemtypeA valid item type.
itemkey | A string generated from the application object's primary key. The string uniquely identifies the item within an item type. The item type and key together identify the process. See: CreateProcess.
aname | An array of the internal names of the item type attributes.
avalue | An array of the values for the item type attributes.

Example

The following example shows how using the SetItemAttributeArray APIs rather than the SetItemAttribute APIs can help reduce the number of calls to the database.

Using SetItemAttrText():

    SetItemAttrText('ITYPE', 'IKEY', 'VAR1', 'value1');

    SetItemAttrText('ITYPE', 'IKEY', 'VAR2', 'value2');

    SetItemAttrText('ITYPE', 'IKEY', 'VAR3', 'value3');

    // Multiple calls to update the database.

Using SetItemAttrTextArray():

    declare

         varname   Wf_Engine.NameTabTyp;

         varval    Wf_Engine.TextTabTyp;

    begin

         varname(1) := 'VAR1';

         varval(1)  := 'value1';

         varname(2) := 'VAR2';

         varval(2)  := 'value2';

         varname(3) := 'VAR3';

         varval(3)  := 'value3';

    Wf_Engine.SetItemAttrTextArray('ITYPE', 'IKEY', varname,                                    varval);

    exception

         when OTHERS then

              // handle your errors here

              raise;

    end;

    // Only one call to update the database.

| Previous | Next |  | Contents | Index | Glossary