mardi 5 mai 2015

SQL Project Help - Using Oracle - Order Entry screen

I'm trying to write the SQL code for oracle sql developer, to output the code below. If someone is willing to help me, I'll also post the file that creates all of the tables and rows with data. thanks!

A sample Order Entry Transaction is as follows: The bold, italic, underlined text indicates user input.

@ c:\neword ********** Order Entry Screen **********

Date: 13-APR-15

Enter Part Number (format 999): 101 Part Description: Air Filter Quantity in stock: 120

Enter Supplier Code (format 999): 102 Address: 456 Main Street City, State Zip: Huntington Beach, CA 92647 Phone: (714) 555-2222

Enter Quantity to Order: 20

Your order has been processed. Order number is: 1010

If there are errors in the order entry process (Order placed with a supplier that is not approved for the part, supplier does not exists, part number does not exist, etc), the order should NOT be processed and the confirmation message should NOT be displayed.

Below is an example of an order placed with a supplier that is not approved for the part:

@ c:\neword ********** Order Entry Screen **********

Date: 13-APR-15

Enter Part Number (format 999): 101 Part Description: Air Filter Quantity in stock: 120

Enter Supplier Code (format 999): 104 Address: 444 Auto Way City, State Zip: Long Beach, CA 90840 Phone: (562) 555-4444

Enter Quantity to Order: 20

INSERT INTO ORD (ORD_NUM, PART_NUM, SUPPLIER_CODE, ORD_QTY, ORD_DATE) * ERROR at line 1: ORA-02291: integrity constraint (ORD_PARTNUM_SUPPCODE_FK) violated - parent key not found

Below is an example of the error messages that should be displayed when the user enters characters instead of number for part number, supplier code, or quantity (the error also appears if part numbers or supplier numbers are more than three digits). Also, notice the information displayed for non-existent parts and/or supplier codes.

Make sure to display similar error messages in your program.

@ c:\neword ********** Order Entry Screen **********

Date: 13-APR-15

Enter Part Number (format 999): Hello SP2-0598: "Hello" does not match input format "999" Enter Part Number (format 999): 9999 SP2-0598: "9999" does not match input format "999" Enter Part Number (format 999): 250 Part Description: Part does not exist Quantity in stock: N/A

Enter Supplier Code (format 999): Test SP2-0425: "Test" is not a valid NUMBER Enter Supplier Code (format 999): 1 Address: Supplier Not Found City, State Zip: NA Phone: NA

Enter Quantity to Order: Ten SP2-0425: "Ten" is not a valid NUMBER Enter Quantity to Order: 10

INSERT INTO ORD (ORD_NUM, PART_NUM, SUPPLIER_CODE, ORD_QTY, ORD_DATE) * ERROR at line 1: ORA-02291: integrity constraint (.ORD_PARTNUM_SUPPCODE_FK) violated - parent key not found

Aucun commentaire:

Enregistrer un commentaire