这篇文章主要介绍“数据库CLOB为空的判断方法是什么”,在日常操作中,相信很多人在数据库CLOB为空的判断方法是什么问题上存在疑惑,小编查阅了各式资料,整理出简单好用的操作方法,希望对大家解答”数据库CLOB为空的判断方法是什么”的疑惑有所帮助!接下来,请跟着小编一起来学习吧!
下列的哪些选项在执行之后会显示 "CLOB has a length of 0" ?
(A)
DECLARE l_clob CLOB; BEGIN IF l_clob IS NULL THEN DBMS_OUTPUT.put_line ('CLOB is NULL'); ELSE DBMS_OUTPUT.put_line ('CLOB has a length of ' || LENGTH (l_clob)); END IF; END; /
SQL> DECLARE 2 l_clob CLOB; 3 BEGIN 4 IF l_clob IS NULL 5 THEN 6 DBMS_OUTPUT.put_line ('CLOB is NULL'); 7 ELSE 8 DBMS_OUTPUT.put_line ('CLOB has a length of ' 9 || LENGTH (l_clob)); 10 END IF; 11 END; 12 / CLOB is NULL PL/SQL procedure successfully completed SQL>
(B)
DECLARE l_clob CLOB := EMPTY_CLOB (); BEGIN IF l_clob IS NULL THEN DBMS_OUTPUT.put_line ('CLOB is NULL'); ELSE DBMS_OUTPUT.put_line ('CLOB has a length of ' || LENGTH (l_clob)); END IF; END; /
SQL> DECLARE 2 l_clob CLOB := EMPTY_CLOB (); 3 BEGIN 4 IF l_clob IS NULL 5 THEN 6 DBMS_OUTPUT.put_line ('CLOB is NULL'); 7 ELSE 8 DBMS_OUTPUT.put_line ('CLOB has a length of ' 9 || LENGTH (l_clob)); 10 END IF; 11 END; 12 / CLOB has a length of 0 PL/SQL procedure successfully completed SQL>
(C)
DECLARE l_clob CLOB := ''; BEGIN IF l_clob IS NULL THEN DBMS_OUTPUT.put_line ('CLOB is NULL'); ELSE DBMS_OUTPUT.put_line ('CLOB has a length of ' || LENGTH (l_clob)); END IF; END; /
SQL> DECLARE 2 l_clob CLOB := ''; 3 BEGIN 4 IF l_clob IS NULL 5 THEN 6 DBMS_OUTPUT.put_line ('CLOB is NULL'); 7 ELSE 8 DBMS_OUTPUT.put_line ('CLOB has a length of ' 9 || LENGTH (l_clob)); 10 END IF; 11 END; 12 / CLOB is NULL PL/SQL procedure successfully completed SQL>
(D)
DECLARE l_clob1 CLOB := EMPTY_CLOB (); l_clob2 CLOB := l_clob1; BEGIN IF l_clob2 IS NULL THEN DBMS_OUTPUT.put_line ('CLOB is NULL'); ELSE DBMS_OUTPUT.put_line ('CLOB has a length of ' || LENGTH (l_clob2)); END IF; END; /
SQL> DECLARE 2 l_clob1 CLOB := EMPTY_CLOB (); 3 l_clob2 CLOB := l_clob1; 4 BEGIN 5 IF l_clob2 IS NULL 6 THEN 7 DBMS_OUTPUT.put_line ('CLOB is NULL'); 8 ELSE 9 DBMS_OUTPUT.put_line ('CLOB has a length of ' 10 || LENGTH (l_clob2)); 11 END IF; 12 END; 13 / CLOB has a length of 0 PL/SQL procedure successfully completed
答案BD. 注意答案C里面的 '' 相当于NULL.
到此,关于“数据库CLOB为空的判断方法是什么”的学习就结束了,希望能够解决大家的疑惑。理论与实践的搭配能更好的帮助大家学习,快去试试吧!若想继续学习更多相关知识,请继续关注亿速云网站,小编会继续努力为大家带来更多实用的文章!
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。