Available in versions: Dev (3.18) | Latest (3.17) | 3.16 | 3.15 | 3.14

This documentation is for the unreleased development version of jOOQ. Click on the above version links to get this documentation for a supported version of jOOQ.

TO_CHAR

Applies to ✅ Open Source Edition   ✅ Express Edition   ✅ Professional Edition   ✅ Enterprise Edition

The TO_CHAR() function converts a value to a string value using a vendor-specific format mask.

SELECT to_char(date '2000-01-01, 'YYYY/MM/DD');
create.select(toChar(Date.valueOf("2000-01-01"), "YYYY/MM/DD")).fetch();

The result being

+------------+
| to_char    |
+------------+
| 2000/01/01 |
+------------+

Dialect support

This example using jOOQ:

toChar(Date.valueOf("2000-01-01"), "YYYY/MM/DD")

Translates to the following dialect specific expressions:

-- AURORA_POSTGRES, DB2, H2, ORACLE, POSTGRES, REDSHIFT
to_char(DATE '2000-01-01', 'YYYY/MM/DD')

-- ACCESS, ASE, AURORA_MYSQL, BIGQUERY, COCKROACHDB, DERBY, EXASOL, FIREBIRD, HANA, HSQLDB, INFORMIX, MARIADB, MEMSQL, MYSQL, 
-- SNOWFLAKE, SQLDATAWAREHOUSE, SQLITE, SQLSERVER, SYBASE, TERADATA, VERTICA, YUGABYTEDB
/* UNSUPPORTED */

(These are currently generated with jOOQ 3.18, see #10141), or translate your own on our website

Feedback

Do you have any feedback about this page? We'd love to hear it!

The jOOQ Logo