|
Note: This topic only summarizes the steps to follow to incorporate a data pipeline into your application. For complete information, see the Building Applications manual.
To use a data pipeline in your applications:
Create a standard class user object that is inherited from the pipeline object in the User Object painter.
Place a DataWindow control in a Window. The control will display the Error DataWindow if errors occur when the pipeline executes.
Write a script for the Window to connect to the source and destination databases. For example:
// Connect to the source database // i_scr is an instance variable of the type transaction. i_src = create transaction i_src.dbms = "ODBC" i_src.dbparm = "Connectstring='DSN=SAMPLE;UID=ADMIN;PWD=SCHOOL'" connect using i_src;
// Connect to the destination database // i_dst is an instance variable of the type transaction. i_dst = create transaction i_dst.dbms = "ODBC"
i_dst.dbparm = "Connectstring='DSN=DEMO;UID=DBA;PWD=SQL'" connect using i_dst;
Add a statement to the script for the Window to create a pipeline object. For example, the following statement creates a pipeline object i_pipe of the class p_test; p_test is a non-visual user object created in the User Object painter and inherited from pipeline. Later, you will assign a pipeline object to i_pipe (just like you assign a DataWindow control a DataWindow object).
i_pipe = create p_test
Tip: You can assign an object to the pipeline object i_pipe in this script or in the script that executes the pipeline. To assign an object to i_pipe, set the dataobject attribute to a string containing the name of a pipeline object. For example:
i_pipe.dataobject = my_pipeline
where my_pipeline is a pipeline object created and saved in the Data Pipeline painter.
Add buttons to execute the pipeline, repair any errors or cancel the execution.
|