ABCD – Aren’t they all right? See trace below.
block is parsed and executed
select statement is parsed, executed and fetched into.
insert statemtent shows a bind variable being used.
create table emp (empno number(3), ename varchar2(10), sal number(3));
declare
v_number number;
begin
select 1 into v_number from user_objects where rownum = 1;
insert into emp values (185, ‘Jones’, 100+v_number);
end;
/
Session traced:
declare
v_number number;
begin
select 1 into v_number from user_objects where rownum = 1;
insert into emp values (185, ‘Jones’, 100+v_number);
B C D are correct, there are no bind variables. So it will not go into bind phase.
B,C,D
B D C
B,C,D
Check beneath, are some completely unrelated internet websites to ours, having said that, they’re most trustworthy sources that we use.
I believe that A is correct because v_sal is used in the insert statement.
ABCD – Aren’t they all right? See trace below.
block is parsed and executed
select statement is parsed, executed and fetched into.
insert statemtent shows a bind variable being used.
create table emp (empno number(3), ename varchar2(10), sal number(3));
declare
v_number number;
begin
select 1 into v_number from user_objects where rownum = 1;
insert into emp values (185, ‘Jones’, 100+v_number);
end;
/
Session traced:
declare
v_number number;
begin
select 1 into v_number from user_objects where rownum = 1;
insert into emp values (185, ‘Jones’, 100+v_number);
end;
call count cpu elapsed disk query current rows
——- —— ——– ———- ———- ———- ———- ———-
Parse 1 0.00 0.00 0 0 0 0
Execute 1 0.00 0.00 0 0 0 1
Fetch 0 0.00 0.00 0 0 0 0
——- —— ——– ———- ———- ———- ———- ———-
total 2 0.01 0.01 0 0 0 1
SELECT 1
FROM
USER_OBJECTS WHERE ROWNUM = 1
call count cpu elapsed disk query current rows
——- —— ——– ———- ———- ———- ———- ———-
Parse 1 0.03 0.03 0 8 0 0
Execute 1 0.00 0.00 0 0 0 0
Fetch 1 0.00 0.00 0 6 0 1
——- —— ——– ———- ———- ———- ———- ———-
total 3 0.03 0.03 0 14 0 1
INSERT INTO EMP
VALUES
(185, ‘Jones’, 100+:B1 )