# Oracle

UI Bakery allows you to easily connect to an Oracle database with no need for additional layers like APIs or third-party services.

## Configuration

### Prerequisites

If your database is hosted behind a Firewall, you need to add our [IP addresses](/concepts/data-sources.md#whitelisting-ip-addresses) to the Firewall whitelist.

### Connecting the data source

To connect your Oracle database, follow these steps:

1. On the **Data sources** page, click **Connect**, and select *Oracle* in the Data sources list.
2. Specify all the required credentials and click **Test connection** to check whether the data source can be connected.
3. Finally, click **Connect Datasource** to complete the setup.

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

UI Bakery will extract the database structure and store column types. This data will be used to suggest the proper[ table columns and form field types](/concepts/components/work-with-components/field-types-and-types-recognition.md).

If you need to be able to override the default data source database with a custom value in an action, you can enable the **Allow override database name in action** setting.

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

Once enabled, when configuring the action, you will be able to specify a custom database. In case a database is not specified, the default data source database will be used.

## Usage

Once you've established the connection between UI Bakery and your Oracle database, you can start interacting with its data. For this purpose, you can use the[ SQL Query](/reference/working-with-actions/sql-query.md) action step.

{% hint style="danger" %}
Pre-defined actions, such as *Load Table*, *Create Row*, etc. are not supported with the Oracle datasource.
{% endhint %}

### Use case: Working with stored procedures

Let's review the use case when you have a stored procedure that performs a calculation and returns the result through an `OUT` parameter. \
For example, the following stored procedure adds two numbers and returns the result as an `OUT` parameter:

```plsql
CREATE OR REPLACE PROCEDURE sum_numbers(
    num1 IN INT,
    num2 IN INT,
    result OUT INT
)
IS
BEGIN
    result := num1 + num2;
END;
/
```

To call this stored procedure from UI Bakery, you need to create a new action of the *SQL Query* type and select your Oracle data source. In the action, you should specify the following query:

```plsql
BEGIN 
    sum_numbers(5, 7, {{ {dir: 3003} }});
END;
```

{% hint style="info" %}
Pay attention to the `{{ {dir: 3003} }}` substitution - it indicates to Oracle that this parameter is an **output** parameter and should return a value. This expression should be passed for all `OUT` parameters of the stored procedure.
{% endhint %}

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


---

# 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://docs.uibakery.io/reference/data-sources/oracle.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.
