# CREATE FUNCTION\_SOURCE

{% hint style="info" %}
**Note** Only valid for approved organizations. Please [contact us to enable functions](https://console.deltastream.io/support-center).
{% endhint %}

## Syntax <a href="#synopsis" id="synopsis"></a>

```sql
CREATE FUNCTION_SOURCE
    function_source_name
WITH (function_source_parameter = value [, ...]);
```

## Description

Defines a new function source from a specified file. For Java functions, this file would be a Java JAR. This provides the source for user-defined functions. See [CREATE FUNCTION](/reference/sql-syntax/ddl/create-function.md) for how to create a function from a function source.

See the [Creating a function](/how-do-i.../creating-a-function.md) tutorial for a full example of adding a [fuunction](/overview/core-concepts/function.md).

### Arguments

#### function\_source\_name

Name of the function source to create. If the name is case-sensitive, you must wrap it in double quotes; otherwise, the system uses the lower case name.

#### WITH (function\_source\_parameter = value \[, …​ ])

This clause specifies the [function source parameters](#function-source-parameters).

### Function Source Parameters

| Parameter Name | Description                                                                                                                                                                                                                                                                                                                            |
| -------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `file`         | <p>Required. Specifies a local filesystem path from which to import the function source. Function source may include one or many functions. See <a data-mention href="/pages/bgJSUOoOsBr5ah3doLEe">/pages/bgJSUOoOsBr5ah3doLEe</a>.<br><br>Type: String<br>Valid values: A valid file path in the current user's local filesystem.</p> |
| `description`  | <p>Optional. Specifies a description for the function source.<br><br>Default value: None<br>Type: String</p>                                                                                                                                                                                                                           |

## Examples

#### Create a new function source

In the below example, a new function source is created with the name `MySrc` from a .jar file available on the local path.

```sh
demodb.public/demostore# CREATE FUNCTION_SOURCE "myFuncs" WITH ( 'file' = '@/path/to/func.jar', 'description' = 'my functions');
+-----------------+---------+----------+------------------------------------------+
|  Type           |  Name   |  Command |  Summary                                 |
+=================+=========+==========+==========================================+
| function_source | myFuncs | CREATE   | function source "myFuncs" was            |
|                 |         |          | successfully created                     |
+-----------------+---------+----------+------------------------------------------+
```


---

# 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://docs.deltastream.io/reference/sql-syntax/ddl/create-function_source.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.
