0% found this document useful (0 votes)
32 views

Test Data For Assignment 1

This document contains test data for procedures in an Oracle database package. It tests procedures for adding, updating, retrieving, and deleting employee and pay details records. It tests procedures both correctly and incorrectly to check for proper behavior and error handling. It also tests retrieving data from the procedures to return as strings or packages to integrate with an external application.

Uploaded by

Nang Lam Le
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
32 views

Test Data For Assignment 1

This document contains test data for procedures in an Oracle database package. It tests procedures for adding, updating, retrieving, and deleting employee and pay details records. It tests procedures both correctly and incorrectly to check for proper behavior and error handling. It also tests retrieving data from the procedures to return as strings or packages to integrate with an external application.

Uploaded by

Nang Lam Le
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 7

Name: Nang Lam LE ID: 6632785 Course ID: HIT2422

TEST DATA FOR ASSIGNMENT


1. Testing call ASS1_TEST_MSG procedure set serveroutput on; begin dbms_output.put_line(ass1_test_msg('Nang')); end; anonymous block completed Hello Nang. Have a nice day 2. ASS1_RESET_TABLES set serveroutput on; begin ass1_reset_tables(); end; select * from employee; select * from paydetails; 3.ASS1_ GET_EMPID Correct employee number: set serveroutput on; begin dbms_output.put_line(ass1_get_empid(2)); end; anonymous block completed 94 Incorrect employee number: set serveroutput on; begin dbms_output.put_line(ass1_get_empid(15)); end; anonymous block completed -1

4. ASS1_ADD_EMP Correct added: set serveroutput on; begin ass1_add_emp(16,'Lam','Nang','M',10.0); end; Incorrect way: Duplicated ID: set serveroutput on; begin ass1_add_emp(2,'Lam','Nang','M',10.0); end; Error report: ORA-20001: Duplicate employee number ORA-06512: at "S6632785.ASS1_ADD_EMP", line 24 ORA-06512: at line 2 Name length is less than 2 and greater than 30: set serveroutput on; begin ass1_add_emp(20,'Le','Nang','M',10.0); end; set serveroutput on; begin ass1_add_emp(20,'Lam','Nanghajdkwialsksmsngjsndngndngnng','M',10.0); end; Error report: ORA-20002: Invalid Name ORA-06512: at "S6632785.ASS1_ADD_EMP", line 34 ORA-06512: at line 2 Invalid Gender: (Not in range (M, F,I,T)) set serveroutput on; begin ass1_add_emp(20,'Lucky','Luke','K',12.0); end; Error report: ORA-20003: Invalid Gender ORA-06512: at "S6632785.ASS1_ADD_EMP", line 36 ORA-06512: at line 2 Invalid Pay rate: set serveroutput on; begin ass1_add_emp(20,'Lucky','Luke','K',1000); end;

Error report: ORA-20004: Invalid Pay Rate ORA-06512: at "S6632785.ASS1_ADD_EMP", line 38 ORA-06512: at line 2 5.ASS1_GET_ONE_EMP Correct: set serveroutput on; begin dbms_output.put_line(ass1_get_one_emp(2)); end; Name: Jay Pritchett, Gender: M, Pay rate: 12.5 Incorrect: set serveroutput on; begin dbms_output.put_line(ass1_get_one_emp(20)); end; Error report: ORA-20005: Employee not found ORA-06512: at "S6632785.ASS1_GET_ONE_EMP", line 23 ORA-06512: at line 2 6.ASS1_UPDATE_PAY_RATE Correct: set serveroutput on; begin ass1_update_pay_rate(2,14); end; check: set serveroutput on; begin dbms_output.put_line(ass1_get_one_emp(2)); end; Name: Jay Pritchett, Gender: M, Pay rate: 14 Incorrect: set serveroutput on; begin ass1_update_pay_rate(20,14); end; Error report: ORA-20005: Employee not found ORA-06512: at "S6632785.ASS1_UPDATE_PAY_RATE", line 15 ORA-06512: at line 2

7.ASS1_ADD_PAY Correct: set serveroutput on; begin ass1_add_pay(2,1,12); end; check: select * from paydetails; Incorrect: Invalid Employee number: set serveroutput on; begin ass1_add_pay(20,1,12); end; Error report: ORA-20005: Employee not found ORA-06512: at "S6632785.ASS1_ADD_PAY", line 22 ORA-06512: at line 2 Duplicated EmpNumber and WeekNo: set serveroutput on; begin ass1_add_pay(2,1,12); end; Error report: ORA-20007: Weekly PayDetail already exists ORA-06512: at "S6632785.ASS1_ADD_PAY", line 32 ORA-06512: at line 2 Invalid HourWorked (0 to 60): set serveroutput on; begin ass1_add_pay(2,2,61); end; Error report: ORA-20008: Invalid Hours Worked ORA-06512: at "S6632785.ASS1_ADD_PAY", line 34 ORA-06512: at line 2 8.ASS1_DELETE_PAY_DETAILS: set serveroutput on; begin dbms_output.put_line(ass1_delete_pay_details(2)); end; anonymous block completed 1

Incorrect: set serveroutput on; begin dbms_output.put_line(ass1_delete_pay_details(12)); end; Error report: ORA-20005: Employee not found ORA-06512: at "S6632785.ASS1_DELETE_PAY_DETAILS", line 16 ORA-06512: at line 2 9.ASS1_DELETE_EMP Correct: set serveroutput on; begin ass1_delete_emp(2); end; Incorrect: set serveroutput on; begin ass1_delete_emp(12); end; Error report: ORA-20005: Employee Not Found ORA-06512: at "S6632785.ASS1_DELETE_EMP", line 20 ORA-06512: at line 2 set serveroutput on; begin ass1_delete_emp(16); end; Error report: ORA-20006: Cannot Delete Employee With Pay Details ORA-06512: at "S6632785.ASS1_DELETE_EMP", line 22 ORA-06512: at line 2 10.ASS1_GET_ALL_EMPS_AS_STRING: set serveroutput on; begin dbms_output.put_line(ass1_get_all_emps_as_string); end; anonymous block completed Name: Gloria Delgado, Gender: F, Pay rate: 9.75; Name: Haley Dunphy, Gender: F, Pay rate: 14; Name: Cameron Tucker, Gender: M, Pay rate: 11.5; Name: Nang Lam, Gender: M, Pay rate: 10;

11.ASS1_GET_ALL_PAYS_AS_STRING: set serveroutput on; begin dbms_output.put_line(ass1_get_all_pays_as_string); end; anonymous block completed EmpNumber: 16, Week: 1, Hours: 14, Pay rate: 10, Total: 140; 12.Testing ASS1_GET_ALL_EMPS_AS_PACKAGE with VB:

13.Testing ASS1_GET_ALL_PAYS_AS_PACKAGE with VB

You might also like