Read Data from Some Table combining by Inner Join

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.

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.

Now assuming the situation any order and item is managed in each table.
In this example, function get data by combining data with ItemCode column. It's equivalant with Inner Join.

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)

When definin Join, either table will be a basis. Specify either of data class name corresponding with base table. In this example, specify OrderInfo.
※ For SQL's Inner Join, it's totally equel with both table. In this tool, either table will be a basis.

Next, back to function list. Then Click "Sync" and specify target fields.

Select Target Table on next page.

Initially only OrderInfo is ticked because it is a basis. This example need to refer ItemInfo table.

So, tick ItemInfo and click "Next" button.

Next window will be displayed. So, please tick target field where you want to get.

In this example, tick all field of OrderInfo and ItemName/ItemDescription of ItemInfo as follows. Then click "UPDATE" button.

After pushing UPDATE button, some WARNING is displayed.

Main target's column is automatically assigned based on table info.
Other table's column is saved to the field by name of "Table Name + Field Name". So, corresponding field must be defined in target data class. So, please use "Add New Field" link and create necessary field. After creation, please push UPDATE button again in this page to confirm all WARNING is dissapeared.

After confirm update, back to function list.

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

Select Target Table on next page. Now, just click "Next" button without change because all target is already selected automatically.

On the next page, default display is only for fields which has a Index. In this example, there is no Index. So, click "Show All Pattern" to show all pattern regardless of Index definition of Table.

Page is displayed as follows.

Some left side columns are a left target table of join. Some Center columns are the target of table combine. Some Right columns are a just information to refer already existing settings.

Initial display is too much to selece. So, use filter to limit the row.

In Parameter's Data Type column you can specify 3 option as follows. This time, specify field to combine table. So, only "anotherfield" id displayed by Parameter Type column. In this image, click "Show only This" on "anotherfield" cell.

  1. Specify parameter by Argument.
  2. Specify fixed value parameter
  3. Specify field to combine field

Show only OrderInfo table. As you can see image, click "Show only This" on "OrderInfo" cell on Table Name column.

By showing ItemCode column, click "Show only This" on ItemCode cell on Colum Name column.

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

Click "Add" button on next window.

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, you can see ItemInfo table and ItemCode table is combined by ItemCode column.

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