

# SHOW CREATE SCALEOUT ROUTING FUNCTION

Use `SHOW CREATE SCALEOUT ROUTING FUNCTION` to read back the definition of a routing function in a database cluster group for Aurora.

## Description and syntax
<a name="databaseclustergroups-sql-show-create-scaleout-routing-function-syntax"></a>

Returns the definition of one routing function. On Aurora MySQL, the result has the columns `Scaleout Routing Function` and `Create Scaleout Routing Function`. The routing layer has no system table that lists routing functions, so this statement is the way to read a definition back.

```sql
SHOW CREATE SCALEOUT ROUTING FUNCTION {{function_name}};
```

## Parameters and options
<a name="databaseclustergroups-sql-show-create-scaleout-routing-function-parameters"></a>

The statement takes the following parameter.

{{function\_name}}  
The routing function to show.

## Where it runs and required privileges
<a name="databaseclustergroups-sql-show-create-scaleout-routing-function-privileges"></a>

Run the statement at the routing endpoint, in a session that isn't pinned. A pinned session passes the statement through to the member cluster unchanged. For the details, see [Where these statements run](databaseclustergroups-sql-reference.md#databaseclustergroups-sql-where-statements-run).

The statement needs no privilege for database cluster groups for Aurora. For the full list of these privileges, see [Privileges](databaseclustergroups-sql-reference.md#databaseclustergroups-sql-privileges).

## Usage notes
<a name="databaseclustergroups-sql-show-create-scaleout-routing-function-usage"></a>

Read each definition back by name, and keep a copy with your export of the data mappings. To find the names, run [SHOW SCALEOUT ROUTING FUNCTIONS](databaseclustergroups-sql-show-scaleout-routing-functions.md).

## Examples
<a name="databaseclustergroups-sql-show-create-scaleout-routing-function-examples"></a>

The following example shows the definition of `tenant_rf`.

```sql
SHOW CREATE SCALEOUT ROUTING FUNCTION tenant_rf;
```

## Errors
<a name="databaseclustergroups-sql-show-create-scaleout-routing-function-errors"></a>

The statement can return the following errors. For all errors from the routing layer, see [Error codes for database cluster groups for Aurora](databaseclustergroups-error-reference.md).


| Aurora MySQL | Meaning | 
| --- | --- | 
| [1064](databaseclustergroups-errors-routing.md#databaseclustergroups-routing-and-statement-errors) | Syntax error: a form outside the grammar. | 
| [1305](databaseclustergroups-errors-scaleout.md#databaseclustergroups-data-mapping-and-scaleout-ddl-errors) FUNCTION <name> does not exist (42000) | No routing function has that name. | 

## Related statements
<a name="databaseclustergroups-sql-show-create-scaleout-routing-function-related"></a>

For more information, see the following:
+ [SHOW SCALEOUT ROUTING FUNCTIONS](databaseclustergroups-sql-show-scaleout-routing-functions.md)
+ [CREATE SCALEOUT ROUTING FUNCTION](databaseclustergroups-sql-create-scaleout-routing-function.md)
+ [SHOW CREATE SCALEOUT TABLE](databaseclustergroups-sql-show-create-scaleout-table.md)