Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I was given the following code to run for testing for the procedures and functions made: / * File: chaudadeDBAS 3 2 1 0 0

I was given the following code to run for testing for the procedures and functions made:
/*
File: chaudadeDBAS32100Assignment1-4.sql
Author: Adeem Chaudhry
Oracle Username: S11_chaudade
Description: Testing Script
*/
-- Undefine variables to prompt for inputs again
UNDEFINE customer_no
UNDEFINE order_date
UNDEFINE part_numbers
UNDEFINE order_price
UNDEFINE order_qty
UNDEFINE invoice_date
UNDEFINE ship_qty
-- Prompt for input
ACCEPT customer_no NUMBER PROMPT 'Enter customer number: ';
ACCEPT order_date DATE PROMPT 'Enter order date (YYYY-MM-DD): ';
ACCEPT part_numbers CHAR PROMPT 'Enter part numbers: ';
ACCEPT order_price NUMBER PROMPT 'Enter order price: ';
ACCEPT order_qty NUMBER PROMPT 'Enter order quantity: ';
ACCEPT invoice_date DATE PROMPT 'Enter invoice date (YYYY-MM-DD): ';
ACCEPT ship_qty NUMBER PROMPT 'Enter ship quantity: ';
-- Variables
DEFINE customer_no = &customer_no
DEFINE order_date ='&order_date'
DEFINE part_numbers ='&part_numbers'
DEFINE order_price = &order_price
DEFINE order_qty = &order_qty
DEFINE invoice_date ='&invoice_date'
DEFINE ship_qty = &ship_qty
-- Test creating a failed order
VAR order_no NUMBER;
VAR status VARCHAR2(100);
EXEC store_new_order(&customer_no, TO_DATE('&order_date', 'YYYY-MM-DD'),'&part_numbers', &order_price, &order_qty, :order_no, :status);
PRINT status;
-- Test creating a correct order
EXEC store_new_order(&customer_no, TO_DATE('&order_date', 'YYYY-MM-DD'),'&part_numbers', &order_price, &order_qty, :order_no, :status);
PRINT status;
-- Display the newly created order
EXEC S11_150.sh_display_order(:order_no);
-- Test creating a failed invoice
VAR invoice_no NUMBER;
EXEC store_new_invoice(:order_no, TO_DATE('&invoice_date', 'YYYY-MM-DD'),'&part_numbers', &ship_qty, :invoice_no, :status);
PRINT status;
-- Test creating two invoices with partially shipped products
EXEC store_new_invoice(:order_no, TO_DATE('&invoice_date', 'YYYY-MM-DD'),'&part_numbers', &ship_qty, :invoice_no, :status);
PRINT status;
-- Display the newly created invoices
EXEC S11_150.sh_display_invoice(:invoice_no);
-- Rollback
ROLLBACK;
-- Commit the final submission
-- COMMIT;
/*
----------------------- Output begins ------------------------
-- Output from executing the insert_order procedure:
----------------------- Output ends ------------------------
*/
This is the output/error I get:
Error starting at line : 21 in command -
BEGIN store_new_order(101,2025-01-02, I65009,149.99,4, :order_no, :status); END;
Error report -
ORA-06550: line 1, column 64:
PLS-00201: identifier 'I65009' must be declared
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored
06550.00000- "line %s, column %s:
%s"
*Cause: Usually a PL/SQL compilation error.
*Action:
STATUS
--------------------------------------------------------------------------------
Error starting at line : 25 in command -
BEGIN store_new_order(101,2025-01-02, I65009,149.99,4, :order_no, :status); END;
Error report -
ORA-06550: line 1, column 64:
PLS-00201: identifier 'I65009' must be declared
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored
06550.00000- "line %s, column %s:
%s"
*Cause: Usually a PL/SQL compilation error.
*Action:
STATUS
--------------------------------------------------------------------------------
PL/SQL procedure successfully completed.
Error starting at line : 34 in command -
BEGIN store_new_invoice(:order_no,2024-05-27, I65009,5, :invoice_no, :status); END;
Error report -
ORA-06550: line 1, column 51:
PLS-00201: identifier 'I65009' must be declared
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored
06550.00000- "line %s, column %s:
%s"
*Cause: Usually a PL/SQL compilation error.
*Action:
STATUS
--------------------------------------------------------------------------------
Error starting at line : 38 in command -
BEGIN store_new_invoice(:order_no,2024-05-27, I65009,5, :invoice_no, :status); END;
Error report -
ORA-06550: line 1, column 51:
PLS-00201: identifier 'I65009' must be declared
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored
06550.00000- "line %s, column %s:
%s"
*Cause: Usually a PL/SQL compilation error.
*Action:
STATUS
--------------------------------------------------------------------------------
PL/SQL procedure successfully completed.
Rollback complete.
Attached is the schema used for the procedures and function and this script was tasked to complete the following:
Write a testing script that uses substitution parameters to perform the following:
Using substitution variables, execute the stored procedure from step #1 to create:
a failed order
a correct order with at least 3 products
Execute S11_150.sh_display_order to display your newly created order
Using substitution variables. execute the stored procedure from step #3 to create:
a failed invoice
two invoices using the newly created order and partially shipped products
Execute S11_150.sh_display_invoice to display your newly created invoices
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Harness The Power Of Big Data The IBM Big Data Platform

Authors: Paul Zikopoulos, David Corrigan James Giles Thomas Deutsch Krishnan Parasuraman Dirk DeRoos Paul Zikopoulos

1st Edition

0071808183, 9780071808187

More Books

Students also viewed these Databases questions