---
title: input_file_name function
description: Learn the syntax of the input\_file\_name function of the SQL language in Databricks SQL and Databricks Runtime.
canonical_url: https://docs.databricks.com/aws/en/sql/language-manual/functions/input_file_name
---

# `input_file_name` function

**Applies to:** ![check marked yes](https://docs.databricks.com/aws/en/images/icons/check.png) Databricks SQL ![check marked yes](https://docs.databricks.com/aws/en/images/icons/check.png) Databricks Runtime

> [!WARNING]
>
> This function is not available on Unity Catalog.
>
> In Databricks Runtime 13.3 LTS and above this function is deprecated. Use [\_metadata.file\_name](https://docs.databricks.com/aws/en/ingestion/file-metadata-column.md).
>
> In Databricks SQL and Databricks Runtime 17.3 LTS and above this function is no longer supported.
>
> Use [\_metadata.file\_name](https://docs.databricks.com/aws/en/ingestion/file-metadata-column.md) instead.

Returns the name of the file being read, or empty string if not available.

## Syntax

```
input_file_name()
```

## Arguments

This function takes no arguments.

## Returns

A `STRING`.

If the information is not available an empty string is returned.

The function is non-deterministic and may return inaccurate results.
Use [\_metadata.file\_name](https://docs.databricks.com/aws/en/ingestion/file-metadata-column.md) instead for reliable results.

## Examples

```sql
> SELECT input_file_name();
```

## Related functions

* [\_metadata](https://docs.databricks.com/aws/en/ingestion/file-metadata-column.md)
