# Get data of database

<div align="left"><figure><img src="/files/ejBZZeDrq5sOKCU38C1E" alt=""><figcaption></figcaption></figure></div>

The image used in the following description is an image of PostgreSQL linkage. \
Other database linkage has the same screen configuration.

## Function overview

* Database data retrieval is linked from the database to the i-Reporter using the ConMas Gateway.

<table><thead><tr><th>Cooperation direction</th><th width="240.33333333333331">Function description</th><th>Execution timing</th></tr></thead><tbody><tr><td>Database→i-Reporter linkage</td><td>Use the ConMas Gateway to get the database data into a cluster of i-Reporter reports.</td><td>Executing the i-Reporter action cluster</td></tr></tbody></table>

## Steps for mapping settings

Follow the steps below to set the mapping.

### 1. Selecting a connection pattern with database

* Click the **get data of database** menu to add a new mapping.

<figure><img src="/files/Ul00LcgC7fucGxDM7lkg" alt=""><figcaption></figcaption></figure>

### 2. Mapping code/name setting

* Set the **mapping code** and **mapping name**.
* A mapping code is the **key that uniquely identifies all mapping configurations within the i-Repo Link environment**.

<figure><img src="/files/GGJr8dCo2t3ivtoHy46x" alt=""><figcaption></figcaption></figure>

### 3. Select the data sources and tables/views as the source of linkage

* Select the database **data source** and **table or view** as the source of linkage.

<figure><img src="/files/z2VB8vXwQL8ev3yEmuYr" alt=""><figcaption></figcaption></figure>

* Refer to the following page to add and configure data sources.

{% content-ref url="/pages/Mr8iIh9WBLvgsGDHpX6I" %}
[Data source management](/i-repo-link-manual/english/system/2/1.md)
{% endcontent-ref %}

### 4. Selecting the Forms to link

<figure><img src="/files/zUacYKL8cO3mm4i1uvgr" alt=""><figcaption></figcaption></figure>

### 5. Map database fields and clusters of i-Reporter form

* The database information is displayed on the left side of the screen, and the i-Reporter report information is displayed on the right side of the screen.
* If the fields in the database are light gray are fields not subject to linkage.&#x20;
* If it cannot be mapped, an error message is displayed.

<figure><img src="/files/Wjq2vf0d0FkkjaZsiNer" alt=""><figcaption></figcaption></figure>

* See the following pages for combinations of fields and clusters that you can map.

{% content-ref url="/pages/Y7Ft3ZPcBcLr747MD2oo" %}
[PostgreSQL and i-Reporter linkage item mapping table](/i-repo-link-manual/english/data-source-linkage-all-databases-common/common/postgresql-and-i-reporter-linkage-item-mapping-table.md)
{% endcontent-ref %}

{% content-ref url="/pages/R6QkYEWr5ZY8AS7lg1yN" %}
[Oracle and i-Reporter linkage item mapping table](/i-repo-link-manual/english/data-source-linkage-all-databases-common/common/oracle-and-i-reporter-linkage-item-mapping-table.md)
{% endcontent-ref %}

### 6. Setting data search condition

* Set search condition to extract data from the database.\
  The report cluster is set to values via the ConMas Gateway based on the found data.
* Specify the database fields and the cluster of i-Reporter.
* Please **set the search condition so that there is only one record**. \
  If multiple records are searched, import report will fail.&#x20;

<figure><img src="/files/VTDSteLLwV5GLy5FUuQQ" alt=""><figcaption></figcaption></figure>

### 7. Setting up Gateway

* **Download the action file** for the ConMas Gateway or **place the action file on the Gateway server**. \
  If you want to place the action file on the Gateway server, please configure ConMas Gateway setting in the system in advance.&#x20;
* Update the parameters of the Gateway to the action cluster of the corresponding form. \
  **The revision of the form will be increased by updating the parameter**.

<figure><img src="/files/mFHLCaeAK7Th06YhhE70" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
**ConMas Gateway Config file to use "deploy to Gateway" button**

You need to use ConMas Gateway 2.1.230200 or later. \
Please change the Config file of the ConMas Gateway. \
Default location of Config file: C:\ConMas\gateway\ Config \default.json \
Open the Config file with a notepad etc. and add the "runMode" Settings described at the end of the following.&#x20;

**default.json file setting**

```json
{
  "port": 3000,
  "ssl": false,
  "sslkey": "./ssl/cert.key",
  "sslcert": "./ssl/cert.pem",
  "authType": "default",
  "token": "token",
  "pythonShell": {
    "mode": "text",
    "encoding": "utf8",
    "pythonOptions": ["-X", "utf8"]
  },
  "uploadFileTypes": {
    "binary": "bmp;gif;jpg;tif;png;wav",
    "text": ""
  },
  "customMaster": {
    "limit": 500
  }
  Add from here (add a comma at the beginning)
  ,
    "runMode": {
    "maintenance": true
  }
  So far.
}
```

{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://cimtops.gitbook.io/i-repo-link-manual/english/menu/get-data-of-database.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
