VOOZH about

URL: https://www.ibm.com/support/pages/node/1167460

⇱ Add ORDERBY parameter to CPYTOIMPF command


Add ORDERBY parameter to CPYTOIMPF command

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 UpdatesDb2 for i Functional Enhancements > Add ORDERBY parameter to CPYTOIMPF command

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 ROWSOPTIMIZE FOR n ROWS
FOR UPDATEFOR READ ONLY
WITH <isolation-level>SKIP LOCKED DATA
USE CURRENTLY COMMITTEDWAIT FOR OUTCOME
Examples:
CPYTOIMPF FROMFILE(CORPDB1/DEPARTMENT) TOSTMF('/dept.file')
RCDDLM(*LF)
ORDERBY('*ARRIVAL')
CPYTOIMPF FROMFILE(CORPDB1/DEPARTMENT) TOSTMF('/dept.file')
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