SW_ADD_PACK_MEMO

The SW_ADD_PACK_MEMO procedure defines an item of pack memo data (a field name/value pair) that will be passed to iProcess with the next command procedure that is called.

Syntax

SW_ADD_PACK_MEMO (
memo_namevarchar(31),
memo_lengthinteger,
memo_datavarbinary(max),
array_idxinteger =0)

where:

memo_name is the name of the iProcess memo field (or memo array field).
memo_length is the number of bytes contained in the memo data.
memo_data is a raw data field that holds the actual memo data.
array_idx (optional) can be specified if memo_name is a memo array field; it identifies the specific element in the memo array to be used. If array_idx is not explicitly set, it defaults to a value of 0.

If memo_name is not a memo array field, you should either not set array_idx, or set it to 0. (If array_idx contains any other value, no memo data will be found; an error message will be written to the SWDIR\logs\sw_warn file.)

Notes

SW_ADD_PACK_MEMO allows pack memo data to be passed to iProcess when a command procedure is called:

You must call SW_ADD_PACK_MEMO to specify the pack memo data immediately before calling the desired command procedure.
A call to SW_ADD_PACK_MEMO defines a single item of pack memo data. If you want to define multiple items of pack memo data, you must make a SW_ADD_PACK_MEMO call for each piece of memo data before calling the desired command procedure.
The pack memo data is only valid for the next command procedure that is called.

Example

In the following example, two SW_ADD_PACK_MEMO calls are used to define memo data values for the two fields, which are passed to iProcess when Case1 is started.

 

begin
declare @mvalue as varbinary(max)
declare @aa as varchar(max)
set @aa = '111111'
set @mvalue = cast(@aa as varbinary(max))
EXEC swpro1.SW_ADD_PACK_MEMO 'MEMO1',6, @mvalue,0
EXEC swpro1.SW_ADD_PACK_MEMO 'MEMO2',6, @mvalue,0
EXEC owner.SW_CASESTART 'CUSTREQ', -1, -1, 'Case1', 'user35', '', 0, 0
end

Note 

This example does not have any explicit transaction control, so will be committed immediately if using Transact-SQL.