> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cockroachlabs.com/llms.txt
> Use this file to discover all available pages before exploring further.

# CALL

The `CALL` [statement](/docs/stable/sql-statements.md) invokes a [stored procedure](/docs/stable/stored-procedures.md).

## Required privileges

To call a procedure, a user must have [`EXECUTE` privilege](/docs/stable/security-reference/authorization#supported-privileges) on the procedure.

## Synopsis

![call syntax diagram](https://mintcdn.com/cockroachlabs/VQ_w3c6MHYdiS7Tn/images/sql-diagrams/common/call.svg?fit=max\&auto=format\&n=VQ_w3c6MHYdiS7Tn\&q=85\&s=3e494778186cbb13dc9bb3d5a659ea50)

## Parameters

| Parameter | Description |
| - | - |
| `proc_name` | The name of the procedure to call. |
| `param_values` | A comma-separated list of parameter values. |

## Examples

### Call a stored procedure

The following statement calls the [`delete_earliest_histories` example procedure](/docs/stable/stored-procedures), specifying 5 rows to delete and a `rides_left` cursor name:

```sql theme={"theme":{"light":"catppuccin-mocha","dark":"catppuccin-mocha"}}
CALL delete_earliest_histories (5, 'rides_left');
```

```
NOTICE: Deleted ride 0a3d70a3-d70a-4d80-8000-000000000014 with timestamp 2019-01-02 03:04:05
NOTICE: Deleted ride 0b439581-0624-4d00-8000-000000000016 with timestamp 2019-01-02 03:04:05.001
NOTICE: Deleted ride 09ba5e35-3f7c-4d80-8000-000000000013 with timestamp 2019-01-02 03:04:05.002
NOTICE: Deleted ride 0fdf3b64-5a1c-4c00-8000-00000000001f with timestamp 2019-01-02 03:04:05.003
NOTICE: Deleted ride 049ba5e3-53f7-4ec0-8000-000000000009 with timestamp 2019-01-02 03:04:05.004
CALL
```

## See also

* [Stored Procedures](/docs/stable/stored-procedures.md)
* [PL/pgSQL](/docs/stable/plpgsql.md)
* [`CREATE PROCEDURE`](/docs/stable/create-procedure)
* [`ALTER PROCEDURE`](/docs/stable/alter-procedure)
* [`DROP PROCEDURE`](/docs/stable/drop-procedure)
