PowerBuilder provides a feature called the data pipeline that you can use to migrate data between database tables. This feature makes it possible to copy rows from one or more source tables to a new or existing destination table -- either within a database, or across databases, or even across DBMSs.
Two ways to use data pipelines
You can take advantage of data pipelines in two different ways:
-
As a utility service for developers
While working in the PowerBuilder development environment, you might occasionally want to migrate data for logistical reasons (such as to create a small test table from a large production table). In this case, you can use the Data Pipeline painter interactively to perform the migration immediately.
For more information on using the Data Pipeline painter this way, see the section called “Working with Data Pipelines” in Users Guide.
-
To implement data migration capabilities in an application
If you are building an application whose requirements call for migrating data between tables, you can design an appropriate data pipeline in the Data Pipeline painter, save it, and then enable users to execute it from within the application.
This technique can be useful in many different situations, such as: when you want the application to download local copies of tables from a database server to a remote user, or when you want it to roll up data from individual transaction tables to a master transaction table.
Walking through the basic steps
If you determine that you need to use a data pipeline in your application, you must determine what steps this involves. At the most general level, there are five basic steps that you typically have to perform.
To pipe data in an application:
-
Build the objects you need.
-
Perform some initial housekeeping.
-
Start the pipeline.
-
Handle row errors.
-
Perform some final housekeeping.
The remainder of this chapter gives you the details of each step.