Solved

Writing a SQL Plus Stored Procedure

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

How to Create User-Defined Aggregates in Oracle Before we begin creating these things, what are user-defined aggregates?  They are a feature introduced in Oracle 9i that allows a developer to create his or her own functions like "SUM", "AVG", and…
Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
This video shows setup options and the basic steps and syntax for duplicating (cloning) a database from one instance to another. Examples are given for duplicating to the same machine and to different machines
Via a live example, show how to restore a database from backup after a simulated disk failure using RMAN.

839 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