KB Article 16074
2019/04/11

Close
X
Contact Tech Support

 Email Tech Support
 (250) 655-1766
 [7:30 - 5:00 PST]
Your Meeting ID will be Provided by a Rep.
Tech Support
Tech Support Home
Software Updates
Knowledge Base Search
Recent KB Articles
Product FAQs
Code Samples
Documentation
Tech Blog
System Requirements
Installation Instructions
Support Testimonials
Contact us to...
Create a Ticket
Request a Free Demo
Suggest a New Feature
Submit Feedback
Upload a Large File
Other Services
Software Training
Professional Services

How to set up WebSmart so you can add MSSQL and DB2 tables to the same program.

Product: WebSmart ILE Type: How to

We had a client who was connecting to both a DB2 and a MSSQL database in the same program.  The hitch is that you cannot add DB2 tables to an MSSQL program or vice versa.  A definition is by default tied to it's repository.  A little back ground,  you've always been able to access the two databases in the same program run.  However, if you DB2 tables are many or have lots of fields that you need to work with the you would have to create work fields in your defintion to serve as place holders for the data.  Following the steps below, you can save yourself a bit of work.

This involves a few steps but mainly you'll have to manipulate the repository in your WebSmart folder on your PC and create your program using the JDBC templates.  Once you do this you can then add the DB2 files to your MSSQL program after the wizard is completed.  If you try to add both the MSSQL tables and the DB2 tables in the Template Wizard,  the Wizard will join them and you can't do that. The Wizard was never designed or intended to access two different repositories at once.  So create the program with your MSSQL tables first, then add the DB2 files afterwards.


In this example I used the MSSQL Public Demo/Customers table and our DB2 XL_WEBDEMO files MU_ITMF and MU_MANF. 

1. With WebSmart closed, Open two Window Explorers
    -one opens C:\ESDI\WebSmart\Repository\MSSQL
    -one opens C:\ESDI\WebSmart\Repository\DB2

2.  Copy your DB2\xl_webdemo mu_itmf.file  and DB2\xl_webdemo mu_manf.file  to the MSSQL folder

3. Open \Repository\MSSQL\main.rps in a text editor and add the following to the bottom, before the last } (curly brace) and save your changes.
    FILE='XL_WEBDEMO/MU_ITMF'
    {
        PCFILE='xl_webdemo mu_itmf.file';
        LVLID='';
    }
    FILE='XL_WEBDEMO/MU_MANF'
    {
        PCFILE='xl_webdemo mu_manf.file';
        LVLID='';
    }


4. Open WebSmart. The reason we closed it earlier was so we can reload the Repository (RPS) into memory after our RPS was updated.  Create your MSSQL program adding only your MSSQL tables and complete the template wizard.

5. Then go to Attributes>Tables and click Add>Browse Repository and select the DB2 files you added via the RPS.

After doing the above you should be able to add the DB2 files to your program and access both databases at the same time during the program run. 


 

Rate This Article

Did this example help you to achieve your goal?
 Yes  No  Don't Know

Enter additional comments below.   If you want to hear back from us, include your contact information.

Email Address:
Comments:
Please enable JavaScript in order to rate this page.