Read Data from Some Table combining by Left Outer Join

It's mostly same as example "Read Data from Some Table combining by Inner Join". The difference is to specify "Left Outer Join" in Where statement.

First, define Table on Database. (See Step 2 on Quick Start Guide about how to do it)

Define Table ItemInfo like this. (This is as same as the sample of "Read Data from Simple One Table")

Insert data as follows by Database Management Tool. (This is as same as the sample of "Read Data from Some Table combining by Inner Join")

Define Table OrderInfo like this. (This is as same as the sample of "Read Data from Simple One Table")

Insert data as follows by Database Management Tool. (This is as same as the sample of "Read Data from Some Table combining by Inner Join")

Now assuming the situation any order and item is managed in each table.

The ItemColde: ghi doesn't exist in ItemInfo Table which is included in OrderInfo table.

In this case, by using prior example "Read Data from Some Table combining by Inner Join", the last row is not output. So, situation will be "Order is not exist" by the prior example because Inner Join combines only when both table exists the data for combination column.
On the other hand, this example will be "Order exists but corresponding item is not exist". This is natual behaviour. By using "Left Outer Join", function can get OrderInfo even if corresponding ItemInfo is not exist.

Importa Table info. (See Step 3 on Quick Start Guide about how to do it)

Next, define function. (See Step 4 on Quick Start Guide about how to do it)

Next, back to function list. Then Click "Sync" and specify target fields. (Details is omitted because is as same as "Read Data from Some Table combining by Inner Join")

Next, condition will be defined to specify target data. Click "Input Aid" on function list.

(Step is almost same as "Read Data from Some Table combining by Inner Join". So skip some steps' explanation)

By filtering until here, you can choose easily. Click "Add" on the top row in the image.

On next window, change Join Type to "Left Outer Join", then click "Add" button.

On function list page, click "View Where" link to check definition.

As follows, you can see condition as if a Specification Document.

Start Build. (See Step 5 on Quick Start Guide about how to do it)

After Build, Endpoint will be created. So, back to function page and click "View Endpoint" link.

Endpoint is displayed as follows.

On Test form, click "Do Test via Server by PHP" button.Two result is displayed. Both is same meaning, only display format is a difference.

By checking data, basically as same as "Read Data from Some Table combining by Inner Join". It is combining OrderInfo and ItemInfo by using ItemCode. The ItemName and ItemDescription for ItemCode: "ghi" is set to null because corresponding data is not exist in ItemInfo table.

Back to top

LoginLogin with this Site's User Name (ID)
Quick Login:Quick Login by Facebook ID (Keep Login Option:ON) / Newly Register


Inquiry

© 2016-2024 Matsuesoft Corporation