Creating a Control Stream
Note: the functionality of this adapter has been replaced by the SQL/MED Plugin for JDBC. If you are new to s-Server, please use this plugin to connect with an external database. This plugin provides SQL/MED access to any foreign DBMS for which a JDBC driver is available.
You can use a Control Stream to pause/suspend and resume reading from your table, which can be useful when the database is down for maintenance. This stream is optional.
Example Control Stream
The following code exemplifies sets up a control stream.
CREATE OR REPLACE FOREIGN STREAM "TableReaderControl" (
"SQLS_cmd" VARCHAR(12) NOT NULL, -- e.g. 'pause'/'suspend', 'resume'
OPTIONS (TYPE 'control')
DESCRIPTION 'TableReader control stream';
Example Insert into Control Stream
The following code is an example of inserting into a control stream.
CREATE OR REPLACE PUMP "100-ControlPump" STOPPED
DESCRIPTION 'pump to stop the action when ROWTIME hits the end of the day' AS
INSERT INTO "ReportControl" ("SQLS_cmd", "SQLS_reason")
SELECT STREAM 'suspend', 'suspend report tailing so can perform nightly migration'