4 to 5 sql statements in procedures

pts.
Tags:
PL/SQL
PL/SQL procedure
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.

Answer Wiki

Thanks. We'll let you know when a new response is added.

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?

Discuss This Question: 2  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • 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 pointsBadges:
    report
  • carlosdl
    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;
    70,220 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following