一、原题

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. 只接受一个参数。
B. 只能被嵌套两级。
C. 参数只能是列值或者常量。
D. 对于查询表的每一行总是返回一个结果行。
E. 返回值的数据类型可以与之前引用的数据类型不同。


三、题目解析

A选项,不正确,单行函数可以接受一个或多个参数。
B选项,不正确,单行函数可以被嵌套多级。
C选项,不正确,参数还可以是变量和表达式。
D选项,正确,单行函数总是返回一个查询表的每行一个结果行。
E选项,正确,单行函数可以返回一个不同的从一个参考数据类型值。

详见联机文档关于单行函数的说明:
        http://docs.oracle.com/cd/E11882_01/server.112/e41084/functions002.htm#SQLRF51178

摘录如下:

    Single-row functions return a single result row for every row of a queried table or view. These functions can appear in select lists, WHERE clauses, START WITH and CONNECT BY clauses, and HAVING clauses.

    Character functions that return number values can take as their argument any character data type. The character functions that return number values are:
ASCII
INSTR
LENGTH
REGEXP_COUNT
REGEXP_INSTR