IC SunsetThe developerWorks Connections platform will be sunset on December 31, 2019. On January 1, 2020, this community and its apps will no longer be available. More details available on our FAQ.
Topic
  • 2 replies
  • Latest Post - ‏2019-04-09T11:53:03Z by robberendt
Sergey Chebotarev
Sergey Chebotarev
2 Posts

Pinned topic DDM file to multi member file and SQL queries

‏2019-03-24T18:56:53Z |

Good day. On a remote IBM i system, there is a multi member file. It is necessary to receive and transfer information to the members of this file. How to create a DDM file so that you can make SQL queries to the desired member?

  • robberendt
    robberendt
    84 Posts

    Re: DDM file to multi member file and SQL queries

    ‏2019-04-09T11:44:21Z  
    -- Get a list of the members on the remote file on GDIHQ
    -- https://www.ibm.com/support/knowledgecenter/ssw_ibm_i_73/db2/rbafzcatsyspstat.htm
    select system_table_member
    from gdihq.qsys2.syspartitionstat
    where system_table_schema='ERPLXF'
    and system_table_name = 'IIM'
    ;
    -- https://www.ibm.com/support/knowledgecenter/ssw_ibm_i_73/db2/rbafzhcalias.htm
    -- Create remote alias on remote system to select member
    create alias gdihq.rob.iim
    for gdihq.erplxf.iim(iim);
    -- Create local alias to point to remote alias
    create alias rob.iim
    for gdihq.rob.iim;
    select * from rob.iim;
  • robberendt
    robberendt
    84 Posts

    Re: DDM file to multi member file and SQL queries

    ‏2019-04-09T11:53:03Z  

    An alternative, if you have an unlimited amount of money, is to look at DB2 Multisystem.  This fully supports members, although members are called partitions in the DB2 world.

    Database ~= System

    Schema = Library

    Table = File

    Row = Record

    Column = Field

    Partition = Member