Use a cursor in a stored procedure
You will be creating a simple stored procedure that uses one or more Cursors - name the stored procedure sp_DisplayMenu. You may develop multiple stored procedures to achieve this.
The stored procedure should accept a single argument - the title of the menu, it will need to find all menu items that match the name (including partial match). For example if you have Chilis Lunch Menu and Chilis To Go Menu - if Chili is passed to the procedure it will show the items from both menus.
In this stored procedure you create a Cursor that scrolls through each MenuItem. For each Item you will produce an output using PRINT that displays MenuGroup and Menu Item as PRINTED output. Note that you will need to change the output screen to text to allow the print to work (Right Click in Query Window, Results, Results to Text).
You output should look something like this
Menu: Chilis To Go Menu Menu Group: Appetizer
Item: Triple Dipper Description: Combine your 3 favorite appetizers!
Item: California Grilled Chicken Flatbread Description: Topped with grilled chicken, applewood smoked bacon, tomato sauce, Monterey Jack, mozzarella, chopped cilantro, house-made pico de gallo, fresh sliced avocado & a drizzle of roasted garlic aioli.
(repeats report for all matching menu items)
|
You will turn in the text of the stored procedure and a screen capture of the execution of this with results.
The video and weekly reading on cursors should be sufficient for this assignment.
5 hours to cover cursors and write all the necessary stored procedures.