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 I debug a stored procedure?
how to implement one-to-one, one-to-many and many-to-many relationships while designing tables? : Sql dba
What is pl/sql table? Why is it used?
How to run sql statements through the web interface?
what are date and time intervals? : Sql dba
What are the two types of periodical indexes?
what are set operators in sql? : Sql dba
What is the purpose of primary key?
Which data type is a composite type?
What is the difference between microsoft access and sql server?
What kind of join is join?
What is pls_integer in pl sql?
What is data types in sql?
How many types of tables are there?
What are character functions?