共计 2137 个字符,预计需要花费 6 分钟才能阅读完成。
这篇文章主要介绍“数据库 CLOB 为空的判断方法是什么”,在日常操作中,相信很多人在数据库 CLOB 为空的判断方法是什么问题上存在疑惑,丸趣 TV 小编查阅了各式资料,整理出简单好用的操作方法,希望对大家解答”数据库 CLOB 为空的判断方法是什么”的疑惑有所帮助!接下来,请跟着丸趣 TV 小编一起来学习吧!
下列的哪些选项在执行之后会显示 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;
/
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;
/
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;
/
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;
/
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 为空的判断方法是什么”的学习就结束了,希望能够解决大家的疑惑。理论与实践的搭配能更好的帮助大家学习,快去试试吧!若想继续学习更多相关知识,请继续关注丸趣 TV 网站,丸趣 TV 小编会继续努力为大家带来更多实用的文章!
正文完