Solved

Writing a SQL Plus Stored Procedure

Posted on 2004-10-17
2
778 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

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

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

Why doesn't the Oracle optimizer use my index? Querying too much data Most Oracle developers know that an index is useful when you can use it to restrict your result set to a small number of the total rows in a table. So, the obvious side…
Background In several of the companies I have worked for, I noticed that corporate reporting is off loaded from the production database and done mainly on a clone database which needs to be kept up to date daily by various means, be it a logical…
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
This video shows how to copy an entire tablespace from one database to another database using Transportable Tablespace functionality.

688 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