Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

2. Write a script that creates and calls a stored procedure named test. This procedure should include these statements coded as a transaction: (Two Screenshots:

2. Write a script that creates and calls a stored procedure named test. This procedure should include these statements coded as a transaction: (Two Screenshots: Script and Executed Results) INSERT INTO orders VALUES (DEFAULT, 3, NOW(), '10.00', '0.00', NULL, 4, 'American Express', '378282246310005', '04/2016', 4); SELECT LAST_INSERT_ID() INTO order_id; INSERT INTO order_items VALUES (DEFAULT, order_id, 6, '415.00', '161.85', 1); INSERT INTO order_items VALUES (DEFAULT, order_id, 1, '699.00', '209.70', 1); Here, the LAST_INSERT_ID function is used to get the order ID value thats automatically generated when the first INSERT statement inserts an order.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Administrator Limited Edition

Authors: Martif Way

1st Edition

B0CGG89N8Z

More Books

Students also viewed these Databases questions