将 ' 替换为 ''

Replace ' by ''

我想在包中的函数中使用 DBMS_JOB.SUBMIT,我这样使用它:

if i_iscsv then
    dbms('true');
    DBMS_JOB.SUBMIT(jobno,
                 'DECLARE            
                 BEGIN
                 get('||req||', '''||i_mail||'''); 
                 COMMIT;
                 END;
                 ');

问题来自 V_REQ,因为我有这样的 dbms :

DECLARE
                 BEGIN
                 get('
    select  distinct
         to_char( date, 'DD/MM/YYYY') date ......

而不是

DECLARE
             BEGIN
             get('
select  distinct
     to_char(date, ''DD/MM/YYYY'') date 

我的 V_REQ 看起来像这样:

 V_REQ := '
    select  distinct
         to_char(date, ''DD/MM/YYYY'') date .....

我怎样才能将'替换为''?

谢谢

您可以使用 Q'[]' 而不是 Single Quote

 V_REQ := Q'[select  distinct to_char(v.date_min, ''DD/MM/YYYY'') date]'

See the difference here