Walks you through the steps required to build and bind the TwoPackageSet program, creating two packages and a plan.
Bind the TwoPackageSet program
Here, you bind the compiled TwoPackageSet program to the DBRM generated when it was compiled. You do this using the HCOSS
Manage Packages and Plans tool to create two packages and a plan. Each package you create is in its own collection and has
a unique qualifier, but both point to the same source member and library. You then bind both packages into one plan.
- Start HCO for SQL Server tools
-
- In
Eclipse, click
Run > Tools > Data Tools > HCO for SQL Server.
- Start the Manage Packages and Plans Tool
-
- From the HCO for SQL Server interface, click
Manage Packages and Plans.
- From the
SQL Server Connection drop-down list, select
HCODemo.
- Create two packages
-
- Click
New Package. Then specify the following:
Property
|
Value
|
Collection Name
|
TEST
|
Library Name
|
<Default>
|
Member Name
|
TWOPACKAGESET
|
Default Qualifier
|
TEST
|
Action
|
Replace
|
- Click
Execute. This creates the package in the database.
- Change the
Collection Name to
PROD and the
Default Qualifier to
PROD.
- Click
Execute. This creates a second package.
- Switch to the
Bind Scripts tab. Notice the BIND script commands that were created as a result of creating each package.
- Bind the two packages into a plan
-
- Click
New Plan.
- In the
Plan Name field, type
TWOPACKAGESET.
- On the
Available Collections list, click
PROD.
- On the
Available Packages list, click
TWOPACKAGESET.
- Click
Add to add this package to the
Selected Packages list.
- Repeat steps 3 through 5, substituting
TEST instead of
PROD, to add the
TEST.TWOPACKAGESET package to the
Selected Packages list.
- In the
Action group, click
Replace.
- Click
Execute to add the BIND PLAN entry to the script and to also bind the plan.
- Verify the results
-
- Using Microsoft SQL Server Management Studio, connect to your SQL Server instance.
- On the
Object Explorer, expand
Databases > HCO_Test > Programmability > Stored Procedures to see the stored procedures HCOSS created when you executed your packages and plan.
- Open one of the stored procedures that contains
PKG as part of its name - right-click the procedure, and click
Modify.
In this, you see the SQL from your application code. You also see SQL Server function calls to UPPER. These were converted
from DB2 function calls to UCASE. This is due to having set the SQL(DIALECT=MAINFRAME) directive when you compiled.