# COPY FUNCTION\_SOURCE

## Syntax

```sql
COPY FUNCTION_SOURCE function_source_name TO 'file_path';
```

## Description

This command downloads a [Function Source](/overview/core-concepts/function.md) in the current organization to a specified file path on the user's local machine.

You can download a function source only if the current role has USAGE privileges.

### Arguments

#### function\_source\_name

This is the name of the function source to copy. If the name is case-sensitive names, you must wrap it in double quotes; otherwise, the lowercase name is used.

#### file\_path

This is the destination file path on the local machine to which the function source file is copied. This is a string value and should be wrapped in single quotes.

### Return

A message indicating the function source was successfully copied (or displays an error otherwise).

## Examples

#### Copy Function Source

```sh
demodb.public/demostore# COPY FUNCTION_SOURCE funcsrc TO '/tmp/funcsrc';
Downloading function source funcsrc to /tmp/funcsrc
```


---

# 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/command/copy-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.
