Salesforce

Direct Open Query Example (Magic xpa 3.x)

« Go Back

Information

 
Created ByKnowledge Migration User
Approval Process StatusPublished
Objective
Description

Direct Open Query Example (Magic xpa 3.x)

If you want to display all records from the CUSTPF table by using the Direct Open Query command, where FLD1 > "A", follow the steps below:

  1. Run the overwrite file command for the CUSTPF file by using the UDF function:
    CallDLL ('MGEAC32.ISERIES','AAAV','RMTCMD', '10.1.4.201',’OVRDBF FILE (CUSTPF) TOFILE(LIBRARY/CUSTPF) OVRSCOPE(*JOB) SHARE(*YES) OPNSCOPE(*JOB) ‘)

  2. Run the Open Query command, which you can enter in the AS/400 Open Query window:
    OPNQRYF FILE(LIBRARY/CUSTPF) QRYSLT (‘FLD1>”A”’) OPNSCOPE(*JOB)

  3. To display the result, run the Magic xpa task that reads the CUSTPF table.

  4. Run the CLOF command by using Magic xpa’s CallDLL function:
    CallDLL ('MGEAC32.ISERIES','AAAV','RMTCMD', '10.1.4.201',’CLOF CUSTPF’)

  5. Run the Delete Overwrite command by using the CallDLL function:
    CallDLL ('MGEAC32.ISERIES','AAAV','RMTCMD', '10.1.4.201',’DLTOVR FILE(*ALL) LVL(*JOB)‘)

Note: 10.1.4.201 is the IBM i system name or IP address.

Reference
Attachment 
Attachment