在 Oracle 10g 之前, SQL 包含單引號的資料處理會是像這樣:
SELECT 'It''s a bird, no plane, no it can''t be ice cream!' AS phrase FROM dual;
那個單引號有時會對應到眼睛脫窗
現在在 Oracle 10g 可以使用 quote delimeter 來讓生活簡單點
以下例而言
SELECT q'(It's a bird, no plane, no it can't be ice cream!)' AS phrase FROM dual;
上述兩個結果都是
PHRASE
------------------------------------------------
It's a bird, no plane, no it can't be ice cream!
沒有留言:
張貼留言