Home » SQL & PL/SQL » SQL & PL/SQL » about excute procedure
about excute procedure [message #615153] Fri, 30 May 2014 13:29 Go to next message
man silence
Messages: 34
Registered: March 2013
Member
I have created this procedure successfully to insert values into tow tables " bill and bill details"
but I don't know how to execute it, and did't work any way

Create or replace procedure New_Bill
(
	   p_BID in bills.BILL_ID %type,
	   p_BRID in bills.BRANCH_ID %type,
	   p_EMPID in bills.EMPLOYEE_ID%type,
	   p_CUSID in bills.CUSTOMER_ID%type,
           p_TOTAL in bills.TOTAL%type,
           p_DISCOUNT in bills.DISCOUNT%type,
           p_F_TOTAL in bills.FINAL_TOTAL%type,
           p_BDATE in bills.BILL_DATE%type,
           p_bill_id in bill_details.BILL_ID%type,
           p_pro_id in bill_details.PRODUCT_ID%type,
           p_cate_id in bill_details.CATEGORY_ID%type,
           p_price in bill_details.PRICE%type,
           p_disc in  bill_details.DISCOUNT%type,
           p_f_price in bill_details.FINAL_PRICE%type,
           p_quantity in bill_details.QUANTITY%type,
           p_tot in bill_details.TOTAL%type
 )
is
begin
  insert into bills
  values (p_BID,p_BRID,p_EMPID,p_CUSID,p_TOTAL,p_DISCOUNT,p_F_TOTAL,p_BDATE);
  insert into bill_details
  values (p_bill_id,p_pro_id,p_cate_id,p_price,p_disc,p_f_price,p_quantity,p_tot);
  commit;
END;


Is there a way to execute it, or my procedure is incorrect?
Re: about excute procedure [message #615154 is a reply to message #615153] Fri, 30 May 2014 13:34 Go to previous messageGo to next message
joy_division
Messages: 4963
Registered: February 2005
Location: East Coast USA
Senior Member
you call the procedure in sqlplus with:
exec new_bill(..all your input values...);

or in pl/sql with:
new_bill(..all your input values...);
Re: about excute procedure [message #615161 is a reply to message #615153] Fri, 30 May 2014 14:37 Go to previous messageGo to next message
Michel Cadot
Messages: 68643
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

2 good books for you:
PL/SQL User's Guide and Reference
Application Developer's Guide - Fundamentals

Re: about excute procedure [message #615166 is a reply to message #615161] Fri, 30 May 2014 15:09 Go to previous message
man silence
Messages: 34
Registered: March 2013
Member
Thanks
I will try
Previous Topic: Replace all substrings by another strings
Next Topic: How to partition Table Data Alphabetically
Goto Forum:
  


Current Time: Tue Apr 23 08:29:19 CDT 2024