两个单引号就转义为单引号,如下

''''||str||''''

eg:

select ''''||to_char(now(), 'yyyy')||''''
'2022'