** In Oracle, double quotation marks are treated as a normal string. ** SELECT
/** In Oracle, double quotation marks are treated as a normal string. **/SELECT
/** Double quotation marks in Oracle "are treated as a normal string **/
/** Test the condition of the three single quotes: ORA-01756: The character strings in the quotation marks do not end properly **/
SELECT ''' from dual;
/** Test the four single quotes: The result is a '(single quotes )**/
-- The second single quotation mark is considered as an escape character by ORACLE by default.
SELECT ''' from dual;
/** Verify that the second single quotation mark is the inference of escape characters, and add a space between the second and third single quotation marks **/
-- Error prompt: ORA-0092: the requested FROM keyword is not found to indicate that the inference is correct
SELECT ''' from dual;
/** Single quotes are often used in dynamic SQL. For example, you need to dynamically add like and write a small test example **/
DECLARE
V_ SQL VARCHAR2 (200 );
N_COUNT NUMBER (4 );
V_NAME VARCHAR2 (100 );
BEGIN
V_NAME: = 'name ';
V_ SQL: = 'select COUNT (1) FROM T1 WHERE 1 = 1 ';
V_ SQL: = CONCAT (V_ SQL, 'AND T1.NAME LIKE' % '| V_NAME |' % ''');
Execute immediate V_ SQL INTO N_COUNT;
DBMS_OUTPUT.PUT_LINE ('n' _ COUNT '|' => '| N_COUNT );
END;
/** Summary:
1. in ORACLE, double quotation marks are processed as common strings.
2. In a single pair of quotes, a pair of adjacent single quotes must be included to indicate a single quotation mark.
3. Two adjacent single quotes. The first one is used to indicate escape characters, and the last one is used to indicate true single quotes.
**/
,