Oracle 11g PL/SQL Programming An analyst in the quality assurance office reviews
ID: 3865215 • Letter: O
Question
Oracle 11g PL/SQL Programming
An analyst in the quality assurance office reviews the time elapsed between receiving an order
and shipping the order. Any orders that haven’t been shipped within a day of the order being
placed are investigated. Create a function named ORD_SHIP_SF that calculates the number of
days between the basket’s creation date and the shipping date. The function should return a
character string that states OK if the order was shipped within a day or CHECK if it wasn’t. If the
order hasn’t shipped, return the string Not shipped. The IDSTAGE column of the
BB_BASKETSTATUS table indicates a shipped item with the value 5, and the DTSTAGE
column is the shipping date. The DTORDERED column of the BB_BASKET table is the order
date. Review data in the BB_BASKETSTATUS table, and create an anonymous block to test all
three outcomes the function should handle.
Explanation / Answer
select TO_DATE(bs.dtstage,'dd-mon-yyyy')- TO_DATE(b.dtordered,'dd-mon-yyyy')
lv_DIFF_DAYS
from bb_basket b join bb_basketstatus ba
on b.idbasket = ba.idbasket
WHERE b.idbasket= P_ID_BASKET;
This program must work..Try and let me know.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.