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
Can a select statement fire a trigger?
How would you pass hints to the sql processor?
what is sql? : Sql dba
What is sqlca in db2?
which command using query analyzer will give you the version of sql server and operating system? : Sql dba
What is a call statement? Explain with an example.
Can we connect to postgresql using sql developer?
How is use pl and sql?
How to run sql commands in sql*plus?
How many types of tables are there?
What is the difference between sql and isql*plus?
What is query optimization in sql?
What is the use of function in sql?
What are the three forms of normalization?
List different type of expressions with the example.