# OCT

## Syntax

```sql
OCT(N)
```

## Description

Returns a string representation of the octal value of N, where N is a longlong ([BIGINT](https://mariadb.com/docs/server/reference/data-types/numeric-data-types/bigint)) number. This is equivalent to [CONV(N,10,8)](https://mariadb.com/docs/server/reference/sql-functions/numeric-functions/conv). Returns `NULL` if N is `NULL`.

## Examples

```sql
SELECT OCT(34);
+---------+
| OCT(34) |
+---------+
| 42      |
+---------+

SELECT OCT(12);
+---------+
| OCT(12) |
+---------+
| 14      |
+---------+
```

## See Also

* [CONV()](https://mariadb.com/docs/server/reference/sql-functions/numeric-functions/conv)
* [BIN()](https://mariadb.com/docs/server/reference/sql-functions/string-functions/bin)
* [HEX()](https://mariadb.com/docs/server/reference/sql-functions/string-functions/hex)

<sub>*This page is licensed: GPLv2, originally from*</sub> [<sub>*fill\_help\_tables.sql*</sub>](https://github.com/MariaDB/server/blob/main/scripts/fill_help_tables.sql)

{% @marketo/form formId="4316" %}
