News
Abstract
The new (optional) ORDERBY parameter specifies the order that the records will be inserted into file.
Content
You are in: IBM i Technology Updates > Db2 for i - Technology Updates > Db2 for i Functional Enhancements > Add ORDERBY parameter to CPYTOIMPF command
ORDERBY parameter values:
1) *NONE - No specific order requested. This is the default value for the command.
2) *ARRIVAL - The records will be inserted in the order they were inserted into the from file.
3) character-value - Specifies an SQL ORDER BY clause that will be used for ordering the records in the to file.
After the ORDER BY detail, the user can tack on the following:
FETCH FIRST n ROWS OPTIMIZE FOR n ROWS
FOR UPDATE FOR READ ONLY
WITH <isolation-level> SKIP LOCKED DATA
USE CURRENTLY COMMITTED WAIT FOR OUTCOME
Examples:
CPYTOIMPF FROMFILE(CORPDB1/DEPARTMENT) TOSTMF('/dept.file')
RCDDLM(*LF)
ORDERBY('*ARRIVAL')
RCDDLM(*LF)
ORDERBY('*ARRIVAL')
CPYTOIMPF FROMFILE(CORPDB1/DEPARTMENT) TOSTMF('/dept.file')
RCDDLM(*LF)
ORDERBY(' DEPTNO ASC FETCH FIRST 5 ROWS ONLY ')
RCDDLM(*LF)
ORDERBY(' DEPTNO ASC FETCH FIRST 5 ROWS ONLY ')
[{"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SWG60","label":"IBM i"},"Component":"","Platform":[{"code":"PF012","label":"IBM i"}],"Version":"All Versions","Edition":"","Line of Business":{"code":"LOB57","label":"Power"}}]
Was this topic helpful?
Document Information
Modified date:
14 January 2020
UID
ibm11167460