4.Which two statements are true regarding single row functions? (Choose two.)
A.They accept only a single argument.
B.They can be nested only to two levels.
C.Arguments can only be column values or constants.
D.They always return a single result row for every row of a queried table.
E.They can return a data type value different from the one that is referenced.
答案:DE
解析:这里考察的是单行函数,单行函数的意思是同时只能对一行进行操作,并且对于输入的每一行返回一行输出结果
A.错误,这里说的是只能有一个参数,nvl2,replace,nvl等等都不止一个参数
B.错误,这里说的是只能嵌套2次,这个也是错误的,应该是没有限制,下面的例子循环了2万次,还是可以的
declare
tsql clob := 'nvl(1,1)';
s integer := 10;
begin
for s in 1 .. 20000 loop
tsql := 'nvl('||tsql||',1)';
end loop;
tsql := 'select '||tsql||' from dual';
execute immediate tsql into s;
dbms_output.put_line(to_char(s));
end;
C.错误,这里说的是参数只能是列值和常量,也可以是变量或者select表达式
D.正确
E.正确,他们能够返回与参数不一样的数据类型,to_char这种函数,或者length或者month_between这种
A.They accept only a single argument.
B.They can be nested only to two levels.
C.Arguments can only be column values or constants.
D.They always return a single result row for every row of a queried table.
E.They can return a data type value different from the one that is referenced.
答案:DE
解析:这里考察的是单行函数,单行函数的意思是同时只能对一行进行操作,并且对于输入的每一行返回一行输出结果
A.错误,这里说的是只能有一个参数,nvl2,replace,nvl等等都不止一个参数
B.错误,这里说的是只能嵌套2次,这个也是错误的,应该是没有限制,下面的例子循环了2万次,还是可以的
declare
tsql clob := 'nvl(1,1)';
s integer := 10;
begin
for s in 1 .. 20000 loop
tsql := 'nvl('||tsql||',1)';
end loop;
tsql := 'select '||tsql||' from dual';
execute immediate tsql into s;
dbms_output.put_line(to_char(s));
end;
C.错误,这里说的是参数只能是列值和常量,也可以是变量或者select表达式
D.正确
E.正确,他们能够返回与参数不一样的数据类型,to_char这种函数,或者length或者month_between这种