十年网站开发经验 + 多家企业客户 + 靠谱的建站团队
量身定制 + 运营维护+专业推广+无忧售后,网站问题一站解决
这篇文章主要介绍“数据库CLOB为空的判断方法是什么”,在日常操作中,相信很多人在数据库CLOB为空的判断方法是什么问题上存在疑惑,小编查阅了各式资料,整理出简单好用的操作方法,希望对大家解答”数据库CLOB为空的判断方法是什么”的疑惑有所帮助!接下来,请跟着小编一起来学习吧!
创新互联建站 - 四川服务器托管,四川服务器租用,成都服务器租用,四川网通托管,绵阳服务器托管,德阳服务器托管,遂宁服务器托管,绵阳服务器托管,四川云主机,成都云主机,西南云主机,四川服务器托管,西南服务器托管,四川/成都大带宽,机柜大带宽、租用·托管,四川老牌IDC服务商下列的哪些选项在执行之后会显示 "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为空的判断方法是什么”的学习就结束了,希望能够解决大家的疑惑。理论与实践的搭配能更好的帮助大家学习,快去试试吧!若想继续学习更多相关知识,请继续关注创新互联-成都网站建设公司网站,小编会继续努力为大家带来更多实用的文章!