如何获得包含标点符号 '
的长度?
示例: -
SELECT LENGTH('A','B','C','D','E','F','G','H','I') FROM dual
答案 0 :(得分:0)
SELECT '''A'',''B'',''C'',''D'',''E'',''F'',''G'',''H'',''I''' FROM DUAL;
-- 'A','B','C','D','E','F','G','H','I'
SELECT LENGTH('''A'',''B'',''C'',''D'',''E'',''F'',''G'',''H'',''I''') FROM DUAL;
-- 35
OR
DECLARE
l_str VARCHAR2(100) := q'['A','B','C','D','E','F','G','H','I']';
BEGIN
DBMS_OUTPUT.PUT_LINE(LENGTH(l_str));
END;
-- 35