ODBC DB2 access multiple file members

Posted by markagrady on 20-Sep-2013 15:14

Please can someone explain in exrtremely simple english, how to access a DB2 file with multiple members from a Progress program?I have very limited knowledge and understanding of the iSeries, but I have two files I need to access that have multiple members.  The file I believe is a physical file and as best I can tell there is no source file (not exactly sure or understand what each of these are).  I have read that I need to create a logical file, but they all seem to talk about building a logical file from a source file and not a physical file.  I have tried to also to figure out how to execute the command below, but get nothing but errors.  How do you execute this command?  Can you please show me the progrss code to do this.{CALL QSYS.QCMDEXC('OVRDBF FILE(IDSDATA/OOIORDDP) MBR(ORDER) OVRSCOPE(*JOB)',0000000049.00000)}

All Replies

Posted by Marek Bujnarowski on 07-Oct-2013 07:28

Multi-member physical files on iSeries are conceptually similar to Progress multi-tenancy tables.  The source file you refer to is the DDS definition where you decide on the object's structure (aka table/view/index). Than you compile it to generate PF or LF on AS/400.  

SQL does not support the multi-member file capability. If you intend to use SQL interface (e.g. via our ODBC DataServer product),  multi-member physical files can be accessed using the OVRDBF (Override Database File) command or using the SQL CREATE ALIAS command., e.g.,

CREATE ALIAS tableXmbr2 for TableX (mbr2 ) redefines “mbr2” of table “TableX” as an alias table named “tableXmbr2”.

As for the file overrides, if you have a DataServer license, you can invoke a stored procedure from Progress client directly, something like:

DEFINE VAR hdl AS INT.

RUN STORED-PROC OVRF hdl = PROC-HANDLE

("OVRDBF FILE(OOIORDDP) TOFILE(IDSDATA/OOIORDDP) MBR(ORDER) OVRSCOPE(*job)").

CLOSE STORED-PROC OVRF WHERE PROC-HANDLE = hdl.

After that, all references to IDSDATA/OOIORDDP will use the overridden member (i.e. ORDER) instead of the first one.

Hope it helps

Marek

This thread is closed