Answer Posted / subhendu
CREATE OR REPLACE Function test( I_name IN varchar2 )
RETURN number
IS
CURSOR c1
IS
SELECT course_number,
instructor
from courses_tbl
where course_name = I_name
FOR UPDATE of instructor;
v_number courses_tbl.course_number%type;
v_instructor courses_tbl.instructor%type;
BEGIN
open c1;
fetch c1 into v_number,v_instructor ;
if c1%found then
UPDATE courses_tbl
SET instructor = 'SMITH'
WHERE CURRENT OF c1;
COMMIT;
end if;
close c1;
RETURN v_number;
END;
Is This Answer Correct ? | 5 Yes | 1 No |
Post New Answer View All Answers
How do you modify a trigger?
What is triggering circuit?
What are the different types of constraints?
how many ways we can we find the current date using mysql? : Sql dba
What are triggers and its uses?
What is dense_rank in sql?
What are different methods to trace the pl/sql code?
Why is a trigger used?
What are the types of triggers in sql?
Can you selectively load only those records that you need? : aql loader
How do you create an update query?
Explain the update statement in sql
What is having clause in sql?
What is %rowtype in pl sql?
What is trigger in pl sql with examples?