Solved

Writing a SQL Plus Stored Procedure

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

Title # Comments Views Activity
Schema creation in Oracle12c 6 48
Why  don't I see Below columns in my  Stored Procedure  under TMP_RS? 8 22
grant user/role question 11 28
Oracle Insert not working 10 28
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…
Have you ever had to make fundamental changes to a table in Oracle, but haven't been able to get any downtime?  I'm talking things like: * Dropping columns * Shrinking allocated space * Removing chained blocks and restoring the PCTFREE * Re-or…
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 Export data from an Oracle database using the Original Export Utility.  The corresponding Import utility, which works the same way is referenced, but not demonstrated.

832 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