Write a program using a cursor to print the delivered orders. If an order is not delivered, extend the delivery date by 10 days.

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
100%

The course I'm taking is database management. 

The question asks to refer to the 'order_db' table which i have attached for reference.

i am using apex oracle as my compiler


Question - Write a program using a cursor to print the delivered orders. If an order is not delivered, extend the delivery date by 10 days. 

 

thank you in advance!

mysql> select * from order_db;
+-
| orderid | custid | itemcode | orderquantity | delivery date | mode of payment | date_of_order |
| 2020-05-28
| 1998-02-15
2024-09-03
250 |
200 |
2
2
2 |
2 |
800 | 2020-05-30
600 | 2021-09-21
| C
| R
500 |
21
2 |
300 |
21
2
75 |
2
2 |
125 2023-06-02
200 | 2020-05-29
| C
265 | 2020-05-29 | C
D
| 1998-02-15
| 1998-02-15
5 rows in set (0.00 sec)
mysql> decs order_db;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL serve
ecs order_db' at line 1
mysql> desc order_db;
--+
| Null | Key | Default | Extra |
Field
orderid
| custid
itemcode
Type
int
| YES | UNI | NULL
| int
int
| YES | MUL | NULL
| YES
| YES
YES
| orderquantity | int
deliverydate |date
| modeofpayment | char(1) | YES |
|date_of_order date
+-
-+--
7 rows in set (0.02 sec)
| YES
NULL
| NULL
NULL
| NULL
| NULL
mysql>
Transcribed Image Text:mysql> select * from order_db; +- | orderid | custid | itemcode | orderquantity | delivery date | mode of payment | date_of_order | | 2020-05-28 | 1998-02-15 2024-09-03 250 | 200 | 2 2 2 | 2 | 800 | 2020-05-30 600 | 2021-09-21 | C | R 500 | 21 2 | 300 | 21 2 75 | 2 2 | 125 2023-06-02 200 | 2020-05-29 | C 265 | 2020-05-29 | C D | 1998-02-15 | 1998-02-15 5 rows in set (0.00 sec) mysql> decs order_db; ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL serve ecs order_db' at line 1 mysql> desc order_db; --+ | Null | Key | Default | Extra | Field orderid | custid itemcode Type int | YES | UNI | NULL | int int | YES | MUL | NULL | YES | YES YES | orderquantity | int deliverydate |date | modeofpayment | char(1) | YES | |date_of_order date +- -+-- 7 rows in set (0.02 sec) | YES NULL | NULL NULL | NULL | NULL mysql>
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 3 images

Blurred answer
Follow-up Questions
Read through expert solutions to related follow-up questions below.
Follow-up Question

i am having a issue with the code. it is not printing for me. i have attached a screen shot of what is does for output. its says 1 row has been updated but its not displaying the output. please assist.

■ APEX
App Builder
SQL Workshop
Team Development ✓ Gallery
↑ SQL Commands
Language
PL/SQL
ว
14
15
C
Q
A==
Rows 10
Clear Command Find Tables
Search
--
Update the delivery date in the order_db table
UPDATE order_db
SET deliverydate = v_delivery_date
WHERE orderid = v_order_id;
-- Print the details of the updated order
DBMS_OUTPUT.PUT_LINE('Order ID: ' || v_order_id || ', Extended Delivery Date: ' || TO_CHAR(V_delivery_date, "YYYY-MM-DD'));
END IF;
23
16
17
18
19
20
21
2222222222
24
END LOOP;
25
END;
26
/
27
Results Explain Describe
Saved SQL History
1 row(s) updated.
0.01 seconds
Transcribed Image Text:■ APEX App Builder SQL Workshop Team Development ✓ Gallery ↑ SQL Commands Language PL/SQL ว 14 15 C Q A== Rows 10 Clear Command Find Tables Search -- Update the delivery date in the order_db table UPDATE order_db SET deliverydate = v_delivery_date WHERE orderid = v_order_id; -- Print the details of the updated order DBMS_OUTPUT.PUT_LINE('Order ID: ' || v_order_id || ', Extended Delivery Date: ' || TO_CHAR(V_delivery_date, "YYYY-MM-DD')); END IF; 23 16 17 18 19 20 21 2222222222 24 END LOOP; 25 END; 26 / 27 Results Explain Describe Saved SQL History 1 row(s) updated. 0.01 seconds
Solution
Bartleby Expert
SEE SOLUTION
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY