# Exec. Procedure

Executes a Stored Procedure in the Server's Database. You must import Stored Procedures (at the Database Connection Profile) before using this Action.

Action available for the following operating systems:

![](/files/-MAlQBZuuTnc6hyzKSVQ)

### Parameters

* **Stored Procedure** - Stored Procedure to be executed.

Sources

* **Source** *\<string> or \<numeric> -* Value to pass to the first Stored Procedure Parameter.

Targets

* **Column** *\<unquoted string> -* Name of the column to retrieve. This parameter is merely informative and has no impact whatsoever. What matters is the index of the Column. Therefore, this refers to the first returned Column.
* **Target** *\<target> -* Control or Variable where to save the value of the first returned Column.

### Usage

Consider the following Database Table:

| **Products**       |                   |                     |
| ------------------ | ----------------- | ------------------- |
| **Code** *Numeric* | **Name** *String* | **Stock** *Numeric* |
| 1                  | Coca Cola         | 100                 |
| 2                  | Pepsi Cola        | 400                 |
| 3                  | Pork Chops        | 300                 |

Consider the following Stored Procedure who returns the stock of a given Product code:

| <p><strong>getStock</strong><br></p> |                    |
| ------------------------------------ | ------------------ |
| **Input Parameter**                  | **Parameter Type** |
| Code                                 | Numeric            |

#### **Example 1**

|                      |            |
| -------------------- | ---------- |
| **Stored Procedure** | getStock   |
| **Parameter**        | **Source** |
| Code                 | 1          |
|                      |            |
| **Column**           | **Target** |
| Stock                | VAR(0)     |

*Result:*

| **Variable** | **Value** |
| ------------ | --------- |
| VAR(0)       | 100       |

{% hint style="warning" %}
Notice that for this operation is necessary to create an ODBC Connnection and a **Database Connection Profile**.
{% endhint %}

{% hint style="info" %}
See **Stored Procedures** chapter for more information.
{% endhint %}

{% hint style="info" %}
Kalipso doesn't support Output Parameters so you have to delete them from the Stored Procedure's definitions inside your Project.
{% endhint %}

{% hint style="info" %}
To return values from a Stored Procedure, just do a Select inside it.
{% 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://doc.sysdevmobile.com/kalipso5/developing/form/actions/actions-description/group-database/exec.-procedure.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.
