DEV Community

Judy
Judy

Posted on

How to Perform Join Queries on Different Types of Databases #72

Problem description & analysis

There is a data table persons in MySQL, as shown below:

Image description
There is a data table orders in Oracle, as shown below:

Image description
We are trying to list all people and all orders in a corresponding way. Below is the desired result:

Image description
Solution

Write the following script p1.dfx in esProc:

Image description
Explanation:

A1  Connect to MySQL database.

A2  Get data from persons table.

A3  Connect to Oracle database.

A4  Get data from orders table.

A5  Perform a full join on A2 and A4 by id_p to list all desired data.

Read How to Call an SPL Script in Java to learn how to integrate the script code into a Java program.

Open source SPL source address

Download

Top comments (0)