About cookies on this site Our websites require some cookies to function properly (required). In addition, other cookies may be used with your consent to analyze site usage, improve the user experience and for advertising. For more information, please review your options. By visiting our website, you agree to our processing of information as described in IBM’sprivacy statement. To provide a smooth navigation, your cookie preferences will be shared across the IBM web domains listed here.
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
More support for:
IBM i
Software version:
All Versions
Operating system(s):
IBM i
Document number:
1167460
Modified date:
14 January 2020
UID
ibm11167460
Manage My Notification Subscriptions