Example 1: Define a Relational Datastore using DDL
DESCRIPTION SQLDDL /home/sqdata/employee.ddl AS EMPLOYEE_DDL;
DATASTORE EMPLOYEE_IN
OF RELATIONAL
AS EMPLOYEE_IN
DESCRIBED BY EMPLOYEE_DDL;
Example 2: Define a Relational Datastore using the RDBMS catalog
An alternative method for defining a relational datastore uses the catalog of the relational database. Define the relational table EMPLOYEE_OUT as a target datastore that uses this layout. Extract the datastore definition for the relational target datastore table EMPLOYEE_OUT by first creating a file (employee.sql) containing the following SQL SELECT statement (must end with a semicolon). Note, use of a SELECT statement to define the layout of a relational table requires the use of the RDBMS command and access to the RDBMS catalog from the system where the Apply Engine script is parsed.
SELECT * FROM EMPLOYEE_OUT;
RDBMS SAMPLE userid password;
DESCRIPTION SQLDML /home/sqdata/employee.sql AS EMPLOYEE_DML;
DATASTORE EMPLOYEE_OUT
OF RELATIONAL
AS EMPLOYEE_OUT
DESCRIBED BY EMPLOYEE_DML;
Example 3: Use DDL and the RDBMS catalog to define datastore formats
RDBMS SAMPLE;
DESCRIPTION SQLDDL employee.ddl AS EMPLOYEE_DDL;
DESCRIPTION SQLDML employee.sql AS EMPLOYEE_DML;
DATASTORE EMPLOYEE_IN
OF RELATIONAL
AS EMPLOYEE_IN
DESCRIBED BY EMPLOYEE_DDL;
DATASTORE EMPLOYEE_OUT
OF RELATIONAL
AS EMPLOYEE_OUT
DESCRIBED BY EMPLOYEE_DML;