|
2012-2-3 答案C.
A,B:语法错误;D:虽然删除了重复数据,但是位置还空着。
========================================
2012-2-6
作者:Valentin Nikotin
难度:高
我创建了如下的函数:
create or replace function plch_func (i number) return number is
begin
dbms_output.put_line('plch_func with i = '||i);
return 1;
end;
/
下列的每个选项都包含一个代码块,它执行一个查询,查询中轮流调用这个plch_func函数。哪些选项会导致下列的两行文本被显示?(顺序无所谓)
plch_func with i = 1
plch_func with i = 2
(A)
declare
val1 number;
val2 number;
begin
select plch_func(1), plch_func(2) into val1, val2
from dual;
end;
/
(B)
begin
for rec in (select plch_func(1), plch_func(2) from dual)
loop
null;
end loop;
end;
/
(C)
begin
execute immediate
'select plch_func(1), plch_func(2)
from dual';
end;
/
(D)
declare
val1 number;
val2 number;
begin
execute immediate
'select plch_func(1), plch_func(2)
from dual'
into val1, val2;
end;
/
(E)
declare
c number := dbms_sql.open_cursor;
rc number;
begin
dbms_sql.parse(c,
'select plch_func(1), plch_func(2) from dual',
dbms_sql.native);
rc := dbms_sql.execute_and_fetch(c);
dbms_sql.close_cursor(c);
end;
/
(F)
declare
c number := dbms_sql.open_cursor;
rc number;
begin
dbms_sql.parse(c,
'select plch_func(1), plch_func(2) from dual',
dbms_sql.native);
dbms_sql.define_column(c, 1, 1);
rc := dbms_sql.execute_and_fetch(c);
dbms_sql.close_cursor(c);
end;
/
|
|