Oracle Alternative Quoting Mechanism (''Q'') for String Literals
https://livesql.oracle.com/apex/livesql/file/content_CIREYU9EA54EOKQ7LAMZKRF6P.html
Oracle Database offers the ability, in both SQL and PL/SQL, to specify our own user-defined delimiters for string literals. Here's how it works: you prefix your literal with the letter "q". Then you type a single quote, followeed by your starting delimiter for the literal. Then you type your literal string without having to double up on your single quote characters. When you have typed in your full literal, terminate it with your ending delimiter, followed by a single quote. In other words, you will follow this general format: q'[your string here]' where "[" represents (and certainly could be used for) the starting delimiter, and "]" represents the ending delimiter. Oracle automatically recognizes "paired" delimiters, such as [], {}, (), and <>. If you want to use some other character as your start delimiter and it doesn't have a "natural" partner for termination, you must use the same character for start and end delimiters. Finally, if you choose a character for a delimiter and it appears in your string immediately before a single quotation mark, Oracle will be unhappy and raise an error.
Oracle 數據庫在 SQL 和 PL/SQL 中都提供了為字符串文字指定我們自己的用戶定義分隔符的能力。它是這樣工作的:你在你的文字前加上字母“q”。然後鍵入一個單引號,然後是文字的起始分隔符。然後你輸入你的文字字符串,而不必在你的單引號字符上加倍。當你輸入完整的文字後,用你的結束分隔符終止它,然後是一個單引號。換句話說,您將遵循以下通用格式: q'[your string here]' 其中“[”表示(當然可以用於)起始分隔符,“]”表示結束分隔符。 Oracle 自動識別“成對的”分隔符,例如 []、{}、() 和 <>。如果您想使用其他字符作為起始分隔符並且它沒有“自然”夥伴來終止,則您必須對起始和結束分隔符使用相同的字符。最後,如果您選擇一個字符作為分隔符並且它出現在您的字符串中的單引號之前,Oracle 將不高興並引發錯誤。
翻譯
使用 q'! !' 不需要用 '' 替代 '