0 pts.
 4 to 5 sql statements in procedures
I want to create 5 sql statements in one procedures which are performing diff tasks. can u provide the pl/sql PROC which can be include 5 sql statements.

Software/Hardware used:
ASKED: June 29, 2009  4:26 AM
UPDATED: July 1, 2009  2:59 PM

Answer Wiki:
You need to add more information to your question. ANY PL/SQL procedure can execute arbitrarily many independent SQL statements. Simple example: create or replace procedure my_proc is begin select sum(price) from sales; update tax_rates set tax_percent = 0.0875 where state = 'CA'; delete from sales_history where sale_date < (sysdate() - 180); ... end; What are you really trying to accomplish?
Last Wiki Answer Submitted:  June 29, 2009  7:14 pm  by  Kccrosser   3,830 pts.
All Answer Wiki Contributors:  Kccrosser   3,830 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

I want to create 5 sql statements in one procedures which are performing diff tasks. can u provide the pl/sql PROC which can be include 5 sql statements. — Note: one time only one sql staement should execute depends on requirement not all sql statements.

 0 pts.

 

The question is still very vague. What is exactly the problem ?

Another example:

create or replace procedure my_proc (p_mode in number)
is
	l_price number;
begin
	if p_mode = 1 then
		select sum(price) into l_price from sales;
	elsif p_mode = 2 then
		update tax_rates set tax_percent = 0.0875 where state = 'CA';
	elsif p_mode = 3 then
		delete from sales_history where sale_date < (sysdate() - 180);
	...
	end if;
...
end;
 63,580 pts.