Give an example of any procedure.

Answer Posted / dev lamani

create or replace procedure Data_Ho(region number,proc
number) is
Data_Not_there exception;
cnt number;
Begin
select count(*) into cnt
from vhub.op_fertilizer_sta_tran
where proc_monyr=proc and region_code=region;
if cnt>=0 then
insert into op_fertilizer_sta
select * from op_fertilizer_sta_tran
where proc_monyr=proc and region_code=region;
else
raise Data_not_there;
end if;
exception
when Data_not_there then
dbms_output.putline('There is no Data Available for this
month for Insertion'|| ' ' || proc);
End;

Is This Answer Correct ?    6 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is primary key secondary key alternate key candidate key?

534


How run sql*plus commands that are stored in a local file?

505


What does plv msg allows you to do?

660


How do you use collections in procedure to return the resultset?

1776


What is cursor in pl sql?

561






what is a trigger in mysql? Define different types of trigger. : Sql dba

536


what is innodb? : Sql dba

564


Which constraints we can use while creating database in sql?

602


Does view store data in sql?

519


What is the example of procedure?

504


How do you run a query?

573


How do you rename a table in sql?

519


What is application trigger?

531


How show all rows in sql?

594


Why sql query is slow?

567