Mass Insert

You may want to have a faster alternative for populating a RDS table instead of calling the 'INSERT' function a large number of times. Specifying an input stem results in a much better performance since only one external call is done for a large number of table rows rather than doing a large number of external command invocations.

The command INGRDS INSERT accepts the parameter STEM in order to read in large number of value-clauses. For example,
INGRDS INSERT table COLUMNS('NAME','FIRST_NAME', 'CITY') STEM(values.)

The parameter STEM specifies the name of the REXX stem that holds a set of value-clauses. Each value-clause within values. i=1,2,3... has the same syntax as you would normally use for parameter VALUES().

This allows you to insert many rows with one command invocation.

Parameter STEM is ignored if parameter VALUES is specified.

Usage Example

Note that the value string must specified with quotes. The quoted strings are separated by comma.

/* generate the value-clauses*/
value 0=1000
do i=1 to values.0
   values.i = "'LastName_"i"','FirstName_"i"','BB_"i"'"
end
/*insert all rows with one INSERT command*/
'INGRDS INSERT' table 'STEM(value.) COLUMNS(name, first_name,city)'