You must specify each table in the database that your program uses with the #table directive:
#table tablename,
tablename,
...
tablename; |
where each tablename is the name of a database table, for example CUSTOMER or REGION. You don't have to put each table name on a new line, only the comma to separate table names is important.
If you are using LIBMAKE with #C and you need more than one copy of a table to be be declared globally you can use the following syntax for a table instead of a simple table name:
tablename.rolename |
For example:
#table customer.cust1,customer.cust2,material; |
would declare one record for the material table, and two for the customer table. cust1 and cust2 are often called table roles, by analogy with the field roles that allow the same field to appear more than once in a DP4 table. You can specify any valid identifier as a table role name.
In your C code you would distriguish between the two copies like this:
rec_fetch(EQUAL,&customer.cust1.l); rec_fetch(EQUAL,&customer.cust2.l); |
The tablename.rolename syntax does not work with the #cpp directive, and should not be required -you can easily create as many instances of your CDP4Customer class object as your require.