---
updatedAt: 2025-07-15T09:33:24.000Z
agentTools:
  projectIndex: https://docs.appery.io/llms.txt
---

# Invoking Storage Procedures and Functions

Component **SQL** in custom flow allows invoking not only SQL queries but also **Storage Procedures and Functions**.

The following examples demonstrate the basic examples for every supported database type

## MySQL

DDL script of **Storage procedure** which returns value passed as the parameter

```sql
CREATE PROCEDURE `echo`(IN message VARCHAR(64))
  BEGIN
    SELECT message;
  END
```

The code of **SQL query** in **SQL** component for that procedure is

```sql
CALL echo('hello')
```

The response of **SQL** component is

```json
[
    {
        "message": "hello"
    }
]
```

## MSSQL

DDL script of **Storage procedure** which returns value passed as the parameter

```sql
CREATE PROCEDURE echo(
  @message VARCHAR(64)
)
AS
  BEGIN
    SELECT @message as message
  END
GO
```

The code of **SQL query** in **SQL** component for that procedure is (both variants are valid)

```sql Variant 1
EXECUTE echo 'hello'
```

```sql Variant 2
{CALL echo('hello')}
```

The response of **SQL** component is

```json
[
    {
        "message": "hello"
    }
]
```

## Oracle

DDL script of Function which returns value passed as the parameter

```sql
CREATE OR REPLACE FUNCTION echo(message VARCHAR2) RETURN VARCHAR2 IS
  lv_temp VARCHAR2(64);
  BEGIN
    SELECT message
    INTO lv_temp
    FROM dual;
    RETURN lv_temp;
  END;
```

The code of **SQL query** in **SQL** component for that function is

```sql
SELECT echo('hello') AS message FROM dual
```

The response of **SQL** component is

```json
[
    {
        "MESSAGE": "hello"
    }
]
```

## Postresql

DDL script of Function which returns value passed as the parameter

```sql
CREATE OR REPLACE FUNCTION echo(message VARCHAR(64)) RETURNS VARCHAR(64) AS $$
    BEGIN
      RETURN message;
    END;
$$ LANGUAGE plpgsql;
```

```sql
SELECT echo('hello') AS message
```

The response of **SQL** component is

```json
[
    {
        "message": "hello"
    }
]
```