--%>

Updating the Status of an Order in SQL

Build a procedure named STATUS_SHIP_SP which permits a company to employee in the Shipping Department to update the status of an order to add up shipping information. The BB_BASKETSTATUS table maintains a list of events for each order and hence a shopper can see the current status, date, and comments as each phase of the order process is finished. The IDSTAGE column of the BB_BASKETSTATUS table recognizes each stage and an IDSTAGE of 3 points out the order has been shipped.
 
The procedure must permit the addition of a row pointing an IDSTAGE of 3, date shipped, tracking number, and shipper. The series BB_STATUS_SEQ is employed to give a value for the primary key column. Test the procedure with the below information:
 
 Basket # = 3
 Date Shipped = 20-FEB-03
 Shipper = UPS
 Tracking # = ZW2384YXK4957

E

Expert

Verified

create or replace procedure "STATUS_SHIP_SP"
(basket IN NUMBER,
tidstage IN NUMBER,
date_shipped IN DATE,
tshipper IN VARCHAR2,
tracking IN VARCHAR2)
is
begin
INSERT INTO BB_BASKETSTATUS (IDSTATUS,IDBASKET,IDSTAGE,DTSTAGE,SHIPPER,SHIPPINGNUM)  VALUES (BB_STATUS_SEQ.NEXTVAL, BASKET,TIDSTAGE,DATE_SHIPPED,TSHIPPER,TRACKING);
 
COMMIT;
 
EXCEPTION
WHEN OTHERS THEN
   raise_application_error(-20001,'An error was encountered - '||SQLCODE||' -ERROR- '||SQLERRM);
end;

   Related Questions in Programming Languages

  • Q : Basic programming help In C Language 1.

    1. In what ways are the initialization, repetition test, and update steps alike for a sentinel-controlled loop and an endfile-controlled loop? How are they different? 2. Rewrite the program segment that follows using a for loop: count = 0;

  • Q : What is Round robin allocation Round

    Round robin allocation: It is an allocation of time slices which repeatedly cycles regarding a set of eligible threads in the fixed order.

  • Q : Write a program that enters some text

    Write a program that enters some text into a char string called char text[100] and does the following: a) Calls a function called void vowels(char text[]) that prints out how many times each vowel (a/A, e/E, I/i, O/o, U/u) was foun

  • Q : Define Livelock Livelock : It is a

    Livelock: It is a situation in which a thread waits to be notified of a condition however, on waking, finds that the other thread has inverted the condition another time. The primary thread is forced to wait again. Whenever this occurs for an indefini

  • Q : How you explain binding in WSDL How you

    How you explain binding in WSDL?

  • Q : Programming analysis and design

    Illustrate the term programming analysis and design in brief.

  • Q : Are you sure that XHTML element name

    Are you sure that XHTML element name case sensitive? Answer: XHTML element names surely are case sensitive. Every element names should be written within lower case l

  • Q : What is an Internet Service Provider

    Internet Service Provider: It is an Internet Service Provider (abbreviated as ISP) gives connections to the Internet for users who do not contain their own network. The ISP gives such user with their own IP address which enables them to interact with

  • Q : How would you extract an exact

    How would you extract an exact attribute by using XSLT, from an element into an XML document?