In some cases, the INSERT, UPDATE and DELETE statements that are generated automatically might not be suitable for the write operation that you want the connector to complete on the database. In these cases, you can enter the INSERT, UPDATE and DELETE statements manually.
To configure the DRS Connector stage to run user-specified SQL statements instead of auto-generated statements you must set the Write mode property in the Usage section to User-defined SQL.
In the DRS Connector stage the statements need to be specified in the Statement property in the SQL category in the Usage section.
The specified statements need to use bind parameters that the stage associates with the columns on the input link. The bind parameters are specified as question marks. The stage then internally translates the question marks to comply with the bind parameter syntax used by the backend database. When multiple statements are specified, the association between question marks and link columns is performed separately for each statement.
The DRS Connector stage also supports InfoSphere® DataStage® syntax for bind parameters which makes use of the ORCHESTRATE keyword to denote bind parameters. In this case the parameters directly reference columns on the link. Each parameter is specified in form ORCHESTRATE. param_name where param_name corresponds to the column on the link that should be associated with that parameter.
You can specify the statements in one of the following combinations:
However, if the DRS Connector stage is configured for the Oracle database type, this combination is supported, but the stage does not run the statements individually. Instead the stage runs the statements as a single anonymous PL/SQL block on every input row. Also in this case array write mode is disabled and the input rows are sent to the database one by one where the PL/SQL block statement runs for them.
In addition to specifying SQL statement directly in the stage, it is possible to store statements in a file on the InfoSphere DataStage Server machine and configure the stage to reference this file. The full path to the file is specified in the stage.
To configure the DRS Connector stage to read statements from a file you must set the Write mode property in the Usage section to User-defined SQL file. The file path can then be provided through the Statement property in the Usage section to User-defined SQL file. If a FILE= or {FILE} prefix is specified for the Statement property in the DRS Connector stage, then the stage treats the remainder of the value as the path to the file that contains the user-defined SQL statements. This is true if the Write mode property in DRS Connector is set to User-defined SQL file, but also when it is set to User-defined SQL.