Solved

Writing a SQL Plus Stored Procedure

Posted on 2004-10-17
2
772 Views
Last Modified: 2012-05-05
I'm new to stored procedures and I'm supposed to write one which will create an invoice once a booking is made and calculate the total amount for the invoice.  The only procedure I need to pass to the procedure is the number of the booking for which I need to create the invoice.  A sequence should be used to generate the invoice number.

The attributes in the INVOICE table are: invoice_no, invoice_date, total_amount, due_date and amount_paid.

Could anybody help please?
0
Comment
Question by:soonshengy
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 6

Accepted Solution

by:
RaisinJ earned 250 total points
ID: 12332831
So to clarify, you need to Insert the new Values of an Invoice, which you want to create, into your "INVOICE" table, then your going to create a report off of this?  Where will fields like "Total_Amount" and "Due_Date" and "Amount_Paid" be derived from?  Are these values which will be passed in from other sources in the DB, or from an application?

Are you aware of Oracle's Sequences, I take it from your statement above you are.  You can use this to create your Invoice Number.  Invoice_Date would just be SYSDATE, the last three fields would need to be passed in or gotten from other sources in your DB.
0
 
LVL 9

Expert Comment

by:pratikroy
ID: 12346813
What is the structure of your "Booking" table ? It sounds like, you will create a record in Booking table, and you should be able to generate (insert) an invoice for the booking.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Working with Network Access Control Lists in Oracle 11g (part 1) Part 2: http://www.e-e.com/A_9074.html So, you upgraded to a shiny new 11g database and all of a sudden every program that used UTL_MAIL, UTL_SMTP, UTL_TCP, UTL_HTTP or any oth…
Working with Network Access Control Lists in Oracle 11g (part 2) Part 1: http://www.e-e.com/A_8429.html Previously, I introduced the basics of network ACL's including how to create, delete and modify entries to allow and deny access.  For many…
This video shows how to copy a database user from one database to another user DBMS_METADATA.  It also shows how to copy a user's permissions and discusses password hash differences between Oracle 10g and 11g.
This video shows how to copy an entire tablespace from one database to another database using Transportable Tablespace functionality.

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question