make to_char() SQL function cacheable for SQC

Change-Id: If1b772b7cd1e0990cdc1387b4fa36bc8eae689e7
Closes-Bug: #1370794