The DATASTORE keyword QUERY provides support for an in-line SELECT clause.
When the source DATASTORE is an RDBMS and it is being read remotely for an initial load or refresh process, a Select statement and WHERE clause can be specified to limit the source data being selected.
Example:
DESCRIPTION SQLDDL /home/sqdata/employee.ddl AS S_EMPLOYEE;
DATASTORE RDBMS
QUERY
/+
SELECT EMPNO, LAST_NAME, FIRST_NAME,... FROM PROD.EMP
WHERE EMPNO = 12345 OR
EMPNO = 12346
+/
OF RELATIONAL
AS CDCIN
DESCRIBED BY S_EMPLOYEE;
Notes:
- The description referenced in the DESCRIBED BY clause must match the DESCRIPTION AS (description_alias) specified for the source table DESCRIPTION.
- The characters "/+" and "+/" must be used to mark the beginning and ending of the in-line SELECT which may span as many lines as required.
- Each column defined in the Source description, which may represent a subset of the actual columns in the table, in this example employee.ddl, must be explicitly listed in the select statement. The best way to do this is to copy and paste the columns from the DESCRIPTION file, removing the DATATYPE specification and other constraints. We do not recommend using SELECT * because the order of the results are unpredictable and may not cause the ENGINE to fail resulting in a corrupted Target.