SQL> SELECT sys.DBMS_ASSERT.enquote_literal('literal without quotes') FROM dual;
DBMS_ASSERT.ENQUOTE_LITERAL('LITERALWITHOUTQUOTES')
---------------------------------------------------
'literal without quotes'
1 row selected.
--Two, among the four enclosed qoutes in the following
--example are treated as escape characters. Hence only
--two paired quotes are displayed by enquote_literal
SQL> SELECT sys.DBMS_ASSERT.enquote_literal('literal with paired ''''quotes') FROM dual;
DBMS_ASSERT.ENQUOTE_LITERAL('LITERALWITHOUT''''QUOTES')
-------------------------------------------------------
'literal with paired ''quotes'
1 row selected.
--First, among the two enclosed qoutes in the following
--example is treated as escape character.
-- Enquote_literal considers the remaining single quote
--
as unpaired and flags it as an exception
SQL> SELECT sys.DBMS_ASSERT.enquote_literal('literal with unpaired ''quotes') FROM dual;
SELECT DBMS_ASSERT.enquote_literal('literal with unpaired ''quotes') FROM dual
*
ERROR at line 1:
ORA-06502: PL/SQL: numeric or value error
ORA-06512: at "SYS.DBMS_ASSERT", line 308
ORA-06512: at "SYS.DBMS_ASSERT", line 358 |