Question: I could use some help on this assignment. This is in Oracle using SQL Plus. SPOOL your output to a text file DECLARE a record
I could use some help on this assignment. This is in Oracle using SQL Plus.
SPOOL your output to a text file
- DECLARE a record variable, a variable to keep track of a change in RoomNum, and two accumulators
- Add procedures to the Print multiple records
- In the BEGIN block add a select statement to read all the ledger records in DDI.LEDGER_VIEW ordered by RoomNum and RegDate
- Add a LOOP
- Use DBMS__OUTPUT.PUT statements to print all the values for each record on a single line. End with a DBMS_OUTPUT.NEW_LINE
- After the LOOP be sure to print the final subtotal and the grand total
Compile and run the procedure
structure of the database:

SQL> DESCRIBE DDI. LEDGER_VIEW; Name Null? Type REGID REGDATE LASTNAME FIRSTNAME ADULTCNT CHILDCNT ROOMNUM ROOMSIZE ROOMBEDCNT ROOMRATE NOT NULL NUMBER NOT NULL DATE NOT NULL VARCHAR2 (16) NOT NULL VARCHAR2 (16) NUMBER NUMBER NOT NULL NUMBER NOT NULL VARCHAR2 (6) NOT NULL NUMBER NOT NULL NUMBER(18,2) SQL>
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
