---
title: "TO_BINARY"
description: "TO_BINARY SQL \uD568\uC218\uB294 \uAC12\uC744 BLOB\uC73C\uB85C \uBCC0\uD658\uD569\uB2C8\uB2E4."
language: ko
source_language: en
translation_state: complete
canonical: https://documentation.invantive.eu/ko/docs/invantive-universalsql/grammar/sql-functions/to-binary
original: https://documentation.invantive.eu/en/docs/invantive-universalsql/grammar/sql-functions/to-binary
updated: 2026-12-04T14:36:04Z
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)) --> TO_BINARY[TO_BINARY]:::quoted
    TO_BINARY --> End((END))
```

## 목적
`TO_BINARY` SQL 함수는 값을 BLOB으로 변환합니다. 텍스트는 UTF--8으로 해석됩니다.

참조: [[ASCII_TO_BLOB]], [[UNICODE_TO_BLOB]] 및 [[HEX_TO_BLOB]].

매개변수:
- 입력(`ANY`): 변환할 값.

반환: 입력값을 BLOB으로 변환한 결과.

## 예시
다음 예제는 텍스트 `hi`를 BLOB으로 변환하고 base64 표현을 조회합니다:
```sql
select base64_encode(to_binary('hi'))

-------------------
aGk=
```
다음 예제는 텍스트 `abc`를 BLOB으로 변환하고 바이트 단위 길이를 조회합니다:
```sql
select length(to_binary('abc'))

-------------------
3
```

