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
what is the difference between a local and a global temporary table? : Sql dba
how would concatenate strings in mysql? : Sql dba
What is an oracle stored procedure?
What plvcmt and plvrb does in pl/sql?
How do you run a query?
What is union and union all keyword in sql?
What is over () in sql?
what is blob? : Sql dba
What are the built in functions of sql?
What is crud sql?
Can you have a foreign key without a primary key?
Why truncate is faster than delete?
What is trigger explain with example?
Why trigger is used in sql?
Can instead of triggers be used to fire once for each statement on a view?