What is the best way to escape non-format characters in Oracle's to_char?

SqlOracleTo Char

Sql Problem Overview


I am trying to print a date in a select statement, but I need to add a letter to the output:

to_char(date_updated, 'YYYY-MM-DDTHH:mm:ss')

Oracle does not like the T. I just want the T to be output like the colons and the dashes. Can I escape it with a backslash or something?

Sql Solutions


Solution 1 - Sql

You just need double-quotes around it:

to_char(date_updated, 'YYYY-MM-DD"T"HH:mm:ss')

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionSixty4BitView Question on Stackoverflow
Solution 1 - SqlChad BirchView Answer on Stackoverflow