This miniβproject demonstrates PL/SQL Collections, Records, and the GOTO statement in a single, realistic scenario: managing vehicle maintenance work orders for a transport fleet.
You will:
- Use a Nested Table (collection) to store part costs for a work order (supports sparse lists and
DELETEgaps). - Use a Record to group vehicle/workβorder fields together.
- Use
GOTOto route the flow for invalid data (e.g., negative part cost) and cost thresholds (e.g., very expensive jobs).
This aligns with your instructorβs focus on PL/SQL composite data types and control flow.
A transport company logs maintenance work orders. For each work order, we must:
- Store part costs (collection) and vehicle info (record).
- Validate inputs (no negative costs; no excessive labor hours).
- Summarize the total parts + labor cost.
- Branch with
GOTOto special handling if invalid data appears or if the job is βHighβCostβ.
- Collections:
TYPE NumTable IS TABLE OF NUMBER;(Nested Table) - Records:
TYPE WorkOrderRec IS RECORD (...); - GOTO:
GOTO InvalidData;/GOTO HighCost;with labels
- Oracle Database (19c+ recommended)
- SQL*Plus or SQL Developer
- Enable server output:
SET SERVEROUTPUT ON;- Open
fleet_maintenance_demo.sqlin SQL Developer (or paste into SQL*Plus). - Ensure
SET SERVEROUTPUT ON;is enabled. - Execute the script.
- Observe output for three scenarios:
- Normal (valid costs)
- InvalidData (negative cost)
- HighCost (very expensive total)
Work Order for Plate: RAD-123Z
Parts (existing indices): 1,3,4
Total Parts Cost: 730.0
Labor Hours: 3.5
Labor Rate: 45
Grand Total: 887.5
Status: OK
[ERROR] Invalid part cost encountered: -250 at index 2
Work order flagged. Review required.
[ALERT] High maintenance cost detected: 5600.0
Apply extra approvals before processing.
plsql-fleet-maintenance-goto/
βββ README.md
βββ fleet_maintenance_demo.sql
βββ documentation/
β βββ report.docx
βββ screenshots/
βββ README.txt
- Name: ASDODJI Le Sage
- Course: INSY 831 β Database Development with PL/SQL
- Institution: AUCA
- Date: November 2025