Advertisement
| 10.11.2008 at 08:40AM PDT, ID: 23806564 |
|
[x]
Attachment Details
|
||
|
[x]
The Solution Rating System
|
||
With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.
Your Input Matters If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support. Thank you! |
||
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: |
CREATE OR REPLACE PACKAGE Process_Orders AS
PROCEDURE Add_Order(p_cno IN orders.cno%TYPE,
p_eno IN orders.eno%TYPE,
p_received IN OUT orders.received%TYPE);
p_creation_date DATE;
p_last_update_date DATE;
p_created_by VARCHAR2(10);
p_last_update_by VARCHAR2(10);
END Process_Orders;
/
show errors
set echo on
DROP SEQUENCE Order_number_seq;
CREATE SEQUENCE Order_number_seq
MINVALUE 1
MAXVALUE 1000000
START WITH 1
INCREMENT BY 1;
CREATE OR REPLACE PACKAGE BODY Process_Orders AS
-- Add a new order for the specified class.
-- Order_number_seq should be used to populate the order number (ONO) column.
PROCEDURE Add_Order(p_cno IN orders.cno%TYPE,
p_eno IN orders.eno%TYPE,
p_received IN OUT orders.received%TYPE) AS
BEGIN
IF p_received = NULL
THEN p_received := CURRENT_DATE;
END IF;
SELECT user INTO p_created_by FROM dual;
SELECT user INTO p_last_update_by FROM dual;
INSERT INTO orders (ono,cno,eno,received,creation_date,created_by,last_update_date,last_update_by)
VALUES (Order_number_seq.NextVal,p_cno,p_eno,p_received, p_creation_date,
p_created_by,p_last_update_date,p_last_update_by );
--Exception Handler:
EXCEPTION
WHEN DUP_VAL_ON_INDEX THEN
DBMS_OUTPUT.PUT_LINE('ERROR - Unique Constraint Violation: ' || SQLERRM);
WHEN OTHERS THEN
DBMS_OUTPUT.PUT_LINE('Undentified error occured: ' || SQLERRM);
END Add_Order;
END Process_Orders;
/
show errors
|
Advertisement