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 to check if a column is nullable before setting to nullable?
Which is faster view or stored procedure?
Why do we need unique key in a table?
what is the command line end user interface - mysql? : Sql dba
What is difference between hql and sql?
Enlist the advantages of sql.
What are the basic sql commands?
write an sql query to get third maximum salary of an employee from a table named employee_table. : Sql dba
How do you sort in sql?
Explain 3 basic parts of a trigger.
What is minus?
How do I run a sql script?
how to do backup entire database? : Transact sql
Is hadoop a nosql?
Why are sql stored procedures used?