---
title: "BASENAME"
description: "BASENAME SQL \uD568\uC218\uB294 \uD30C\uC77C \uACBD\uB85C\uC5D0\uC11C \uD30C\uC77C \uC774\uB984\uC744 \uCD94\uCD9C\uD569\uB2C8\uB2E4."
language: ko
source_language: en
translation_state: complete
canonical: https://documentation.invantive.eu/ko/docs/invantive-universalsql/grammar/sql-functions/basename
original: https://documentation.invantive.eu/en/docs/invantive-universalsql/grammar/sql-functions/basename
updated: 2026-12-04T13:22:05Z
license: https://documentation.invantive.eu/ko/
---

## 구문
```mermaid
%%{init: {
  'theme': 'base',
  'flowchart': { 'padding': '7', 'nodeSpacing': '20', 'rankSpacing': '20' },
  'themeVariables': {
    'fontSize': '11px',
    'fontFamily': 'Arial'
  }
}}%%
flowchart LR
    Start((START)) --> BASENAME[BASENAME]:::quoted
    BASENAME --> FUNCPARS1["("]:::quoted
    FUNCPARS1 --> FUNCPARS2[parameters]
    FUNCPARS2 --> FUNCPARS3[")"]:::quoted
    FUNCPARS3 --> End((END))
```

## 목적
`BASENAME` SQL 함수는 파일 경로에서 파일 이름을 추출합니다.

매개변수:
- 파일 경로(`varchar2`): 파일 이름을 포함하며, 드라이브, 폴더 및 확장자도 포함될 수 있는 파일의 전체 경로입니다.
- 확장자(선택 사항, `varchar2`): 제거할 확장자입니다. 필요한 경우 선행 '.'을 포함합니다.

반환값: 파일 경로에서 얻은 파일 이름을 `varchar2` 형식으로 반환합니다.

## 예시
다음 예제는 파일 이름과 경로에서 파일 이름을 추출합니다:
```sql
select basename('c:\temp\myfile.png')

--------------------
myfile.png
```
다음 예제는 파일 이름과 경로에서 파일 이름을 추출하며, `.png` 확장자를 제거합니다:
```sql
select basename('c:\temp\myfile.png', '.png')

--------------------
myfile
```

