-
-
-
-
-
-
-
-
Give the structure of the function ?
FUNCTION name (argument list .....) Return datatype is local variable declarations Begin executable statements Exception execution handlers End;
-
-
-
-
-
-
-
-
-
-
-
-
Example:
declare
cursor CSRtest is
select *
from emp
for update of lastname;
begin
for i in CSRtest loop
...do something
...call procfedure with "commit"
update emp set lastname = "..."
where current of CSRtest;
endloop;
Results in "ORA-01002: fetch out of sequence" because curser is closed after "Commit"
How to "save state of curser" ?
Any workaround?">How to run a curser for update "with hold2 in PL/SQL ?Example:declarecursor CSRtest is select * from emp for update of lastname;beginfor i in CSRtest loop...do something...call procfedure with "commit"update emp set lastname = "..." where current of CSRtest;endloop;Results in "ORA-01002: fetch out of sequence" because curser is closed after "Commit"How to "save state of curser" ?Any workaround?
PL/SQL Interview Questions
Ans