# Error 1305: does not exist

| Error Code | SQLSTATE | Error                    | Description          |
| ---------- | -------- | ------------------------ | -------------------- |
| 1305       | 42000    | ER\_SP\_DOES\_NOT\_EXIST | %s %s does not exist |

## Possible Causes and Solutions

This error is returned when what is being called does not exist. For example:

```
CALL Reset_animal_count();
ERROR 1305 (42000): PROCEDURE test.Reset_animal_count does not exist

SELECT Reset_animal_count();
ERROR 1305 (42000): FUNCTION test.Reset_animal_count does not exist
```

There are a number of possible causes:

* The [stored procedure](/docs/server/server-usage/stored-routines/stored-procedures.md) or [stored function](/docs/server/server-usage/stored-routines/stored-functions.md) has not yet been created. See [CREATE PROCEDURE](/docs/server/server-usage/stored-routines/stored-procedures/create-procedure.md) or [CREATE FUNCTION](/docs/server/reference/sql-statements/data-definition/create/create-function.md). For example:

```
DELIMITER //
CREATE PROCEDURE Reset_animal_count()                      
    MODIFIES SQL DATA
    UPDATE animal_count SET animals = 0;
 //
Query OK, 0 rows affected (0.032 sec)

DELIMITER ;

CALL Reset_animal_count();
Query OK, 0 rows affected (0.001 sec)
```

* There was a typo in the name. Check also that the case is correct. See [Identifier Case-sensitivity](/docs/server/reference/sql-structure/sql-language-structure/identifier-case-sensitivity.md). For example:

```
CALL reset_animal_count();
ERROR 1305 (42000): PROCEDURE test.Reset_animal_count does not exist

CALL Reset_animal_count();
Query OK, 0 rows affected (0.001 sec)
```

* The database specified is not the same as the database containing the stored procedure or function. For example:

```
use test2
CALL Reset_animal_count();
ERROR 1305 (42000): PROCEDURE test2.Reset_animal_count does not exist
```

Either change the default (current) database with the [USE statement](/docs/server/reference/sql-statements/administrative-sql-statements/use-database.md), or specify the database in the call, for example:

```
CALL test.Reset_animal_count(); 
Query OK, 0 rows affected (0.001 sec)
```

or

```
use test
CALL Reset_animal_count();
Query OK, 0 rows affected (0.001 sec)
```

* One is trying to access a stored procedure instead of a stored function, or vice-versa. For example:

```
SELECT Reset_animal_count();
ERROR 1305 (42000): FUNCTION test.Reset_animal_count does not exist

CALL Reset_animal_count();  
Query OK, 0 rows affected (0.001 sec)
```

<sub>*This page is licensed: CC BY-SA / Gnu FDL*</sub>

{% @marketo/form formId="4316" %}


---

# 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://mariadb.com/docs/server/reference/error-codes/mariadb-error-codes-1300-to-1399/e1305.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.
