3 Pages

Lab7

Course: CSSE 333, Fall 2009
School: Rose-Hulman
Rating:
 
 
 
 
 

Word Count: 1142

Document Preview

Introduction CSSE333 to Databases Lab Assignment Lab 7: Stored Procedures Pair Programming You may choose to work with a partner on this lab. This lab is the most challenging thus far, so we are encouraging (but not requiring) pair programming. Objective The goal of this lab is to introduce you to stored procedures. You will be creating a few stored procedures that will allow users to create, update and delete...

Register Now

Unformatted Document Excerpt

Coursehero >> Indiana >> Rose-Hulman >> CSSE 333

Course Hero has millions of student submitted documents similar to the one
below including study guides, practice problems, reference materials, practice exams, textbook help and tutor support.

Course Hero has millions of student submitted documents similar to the one below including study guides, practice problems, reference materials, practice exams, textbook help and tutor support.
Introduction CSSE333 to Databases Lab Assignment Lab 7: Stored Procedures Pair Programming You may choose to work with a partner on this lab. This lab is the most challenging thus far, so we are encouraging (but not requiring) pair programming. Objective The goal of this lab is to introduce you to stored procedures. You will be creating a few stored procedures that will allow users to create, update and delete order details in the Northwind database. These stored procedures will enforce some simple business logic. Resources The example stored procedures get_Order Details_1 and update_Order Details_1 found in the file SprocExamples.txt (in the Lab Instructions folder on Angel) provide examples of coding conventions, validating parameters, raising errors, and appropriate comments. Turn in Instructions Place your .sql files for creating your stored procedures in a .rar (or .zip). Also include a text file named who.txt listing you and your partners names. Place your archive in the Lab 7 drop box. CSSE333 Introduction to Databases Lab Assignment Assignment Details 1) In your copy of Northwind, you will first create basic frameworks for the stored procedures. You can do this either by using the Create Procedure Basic Template in the Template Explorer(View> Template Explorer) within Server Management Studio or by using the following queries: CREATE PROCEDURE [insert_Order Details_1] (@OrderID_1 [int], @ProductID_2 [int], @UnitPrice_3 [money] = NULL, @Quantity_4 [smallint], @Discount_5 [real] = 0) AS INSERT INTO [Northwind].[dbo].[Order Details] ( [OrderID], [ProductID], [UnitPrice], [Quantity], [Discount]) VALUES ( @OrderID_1, @ProductID_2, @UnitPrice_3, @Quantity_4, @Discount_5) GO CREATE PROCEDURE [update_Order Details_1] (@OrderID_1 [int], @ProductID_2 [int], @NewQuantity_4 [smallint]= NULL, @NewUnitPrice_3 [money] = NULL, @NewDiscount_5 [real] = NULL) AS -- Update Order Detail values UPDATE [Northwind].[dbo].[Order Details] SET [Quantity] = @NewQuantity_4, [UnitPrice] = @NewUnitPrice_3, [Discount] = @NewDiscount_5 WHERE ( [OrderID] = @OrderID_1 AND [ProductID] = @ProductID_2) GO ALTER PROCEDURE [delete_Order Details_1] (@OrderID_1 [int], @ProductID_2 [int]) AS --Delete the row with the given OrderID and ProductID in the OrderDetails table DELETE [Northwind].[dbo].[Order Details] WHERE ( [OrderID] = @OrderID_1 AND [ProductID]= @ProductID_2) GO 2) The stored procedure [delete_Order Details_1] simply takes an order ID and product ID and deletes the corresponding record from the Order Details table. When an item is deleted from Order Details, the company wants to adjust the quantity in stock for the product to reflect that the units werent sold after all. Your first task is to refine the stored procedure to account for this. You should modify the stored procedure. One way to do so, is to expand your copy of Northwind, then expand Programmability and Stored Procedure. Right click on delete_Order Details_1 and select Modify. a. Your procedure must be well documented. It should have comments for CSSE333 Introduction to Databases Lab Assignment major subsections. It should also include a header block describing the purpose of the procedure, giving an example usage, your name(s), and the current date. See the stored procedures listed in Resources above for examples. b. Your procedure should validate parameters. It should return an error code (a non-zero result) and print a message if the parameters are invalid. Parameters are valid if the given order ID appears in the table and if the given product ID appears in that order. c. Your procedure return should 0 if the delete is successful, otherwise it should return an error code and print a message. 3) The stored procedure [update_Order Details_1] wizard takes all the data for a single row in the Order Details table, plus an additional order ID and product ID corresponding to the primary key. The stored procedure finds the row with the matching primary key and updates that rows values to match those passed to the procedure. Your task is to refine the stored procedure to meet the following additional requirements: a. The OrderID and ProductID of a row cannot be changed. That is, the procedure should take just one of each argument and should use those arguments to find the row to be changed. Only the Quantity, UnitPrice, and Discount of that row can be changed. (If an end user wanted to change the OrderID or ProductID, she would have to delete the row and add a new row.) b. The Quantity, UnitPrice and Discount parameters should be optional. One way to do this is to set default magic values for the parameters in the procedure declaration, like @UnitPrice [money] = 0. Then you can check whether the actual value of @UnitPrice matches the default, indicating that the argument was omitted. You should choose default values that wont actually be used. (Consider, can you really do that?) c. When updating the record, do not change Quantity, UnitPrice and Discount values unless new values were provided. d. Adjust the quantity in stock for the product by adding the old quantity back to inventory and subtracting the new quantity from inventory. e. However, if there is not enough of a product in stock, then abort the stored procedure without making any changes to the database. f. Print a message if the quantity in stock of a product drops below its Reorder Level as a result of the update. In addition to satisfying the functional requirements above, make sure that your stored procedure is well documented, validates parameters, and returns appropriate result codes as in the previous task. 4) The stored procedure [insert_Order Details_1] takes all the data for a single row in the Order Details table and adds a row with those va...

Find millions of documents on Course Hero - Study Guides, Lecture Notes, Reference Materials, Practice Exams and more. Course Hero has millions of course specific materials providing students with the best way to expand their education.

Below is a small sample set of documents:

Rose-Hulman - CSSE - 497
The ins and outs of problem statementsIn this document we answer the following three questions: 1. What is a problem statement, and whats it good for? 2. What exactly does a problem statement look like? 3. Whats a good process, for deriving a problem sta
Rose-Hulman - CSSE - 497
Usability Test PlansCSSE 376 Software Quality Assurance Mark Ardis, Rose-Hulman Institute April 17, 20061Outline Purpose of Test Plans Suggested Format2Purpose of Test Plans Blueprint for test Communication with development team Describes needed re
Rose-Hulman - EM - 101
~L-!\.6.139 Determine; the magnitude of the gripping forces exerted along; line aa on the nut when tWo240-N forces are applied to the handles as shown. Assume that pins A and D slide freely in slots cut in the jaws. a~~90mm ,I,mm~www xtx(/)a)(
Rose-Hulman - EM - 101
,-6.9 Determine the force in eachmemberof the Gambrel roof truss shown.Statewhethereachmemberis in tensionor compression.~-c~J6kN6 kN6 kN1.2mm~t~ wwUi~000 It)OO -N .-~1-4 IIIFig. P6.94m4m4m~~Ex.T~/Z."A"1.-~O;[!ofp G,112.'1.-1-+'2.-]
Rose-Hulman - EM - 101
--6.99 For the frameandloadingshown,determinethe com-~"c'~- "i\ .-ponentsof all forcesactingon memberABE.~"-,~,s4.2.~ ~ ffi w.uw:I: x: :I:CJ)Cl)(I) 0001t)00 .-N.-c-.~3.6ftFig. P6.993.6ft1.2 ft-~~o:tE )tr~(Ut/1'n-f-6D~~~E~I"-"'
Rose-Hulman - EM - 101
"' .YI I I50lb1/79 Replacethe three forces acting on the bent pipe by ab10"~single equivalent force R. Specify the distancex from point 0 to the point on the x-axis through which theline of actionof R passes. Ans. R = -50i + 20j lb, x = 65 in. (of
Rose-Hulman - AB - 310
Carbon molecules synthesized.Carbon molecules broken down.Evolution . open ocean coastal regions terrestrial Evolution . single cell multicellular specialized structuresOleson, K., and G.B. Bonan, 2000: The effects of remotely-sensed plant functional t
Rose-Hulman - CS - 414
Feasibility study outline (Pressman) 1. Introduction Statement of problem Implementation environment Constraints 2.Summary & Recommendations Important findings Comments Recommendations Impact 3. Alternatives Alternative system configurations Criteria used
Rose-Hulman - CSSE - 371
CSSE 371Week 6 Day 1 QuizMon October 8 2007Name: _ Mail Box: _1. Why do requirements change?2. Mention some external factors that are responsible for changing requirements.3. Mention some internal factors that are responsible for changing requiremen
Rose-Hulman - CSSE - 374
CSSE 374 - Software Architecture and Design - Winter 2008-9 Quiz 5 Monday, December 8, 2008Name:_Grade:_1. How many SSD's would you have for each use case, if you did a complete job of these?2. In the labels on each arrow in an SSD, like enterItem(ite
Rose-Hulman - ES - 204
ROSE-HULMAN INSTITUTE OF TECHNOLOGYDepartment of Mechanical EngineeringES 204 Mechanical SystemsQuiz - Le 22Name: _yB All velocities and accelerations are x assumed positive! 1m G1.Point A has a constant velocity of 10 m/s to the right. Determine
Rose-Hulman - CSSE - 372
CSSE 372- Quiz 19Name: _Score: _Chapters 17-19I.RUBRIC31.Jan.08Client Checkpoint a. Inputs i. Planned vs. actual functionality added ii. Scope bankb. Questions to be answered i. What was planned? ii. iii. iv. v. What was done? Is the version scope
Rose-Hulman - ES - 204
ROSE-HULMAN INSTITUTE OF TECHNOLOGYDepartment of Mechanical EngineeringES 204 Mechanical SystemsQuiz - Le 141.Name: _Sketch the location of the IC for the rigid bodies marked with arrows. Do not worry about figuring out the exact locations. a) b)2.
Rose-Hulman - ES - 204
ROSE-HULMAN INSTITUTE OF TECHNOLOGYDepartment of Mechanical EngineeringES 204 Mechanical SystemsQuiz - Le 22Name: _yB All velocities and accelerations are assumed positive!1.Point A has a constant velocity of 10 m/s to the right. Determine the vel
Rose-Hulman - CSSE - 375
CSSE 375 This is not to be turned in!SourceForge HandoutSeptember 28, 20061. First, go to http:/www.sourceforge.net, register if you haven't done so for some previous purpose, and then log in. 2. Take a look at the following projects (you may wish to d
Rose-Hulman - CSSE - 375
CSSE 375 This is not to be turned in!C+ HandoutSeptember 8, 2006Consider once again the CHECK.CPP sample source code. 1. What is the purpose of `\0' in the code?2. Change the code so that the main program is now an int function which always returns a
Rose-Hulman - CSSE - 375
RightMakingsundials.Fromwebsite www.davidharbersundials.co.uk/craftsmanship.htm.Software CraftsmanshipSteve Chenoweth CSSE 375, Rose-Hulman Based on Don Bagerts 2006 Lecture1Today ReviewSPEHW. Softwarecraftsmanshipthis. TonightTurninHW6. TomorrowRev
Rose-Hulman - CSSE - 375
Tori Bowman CSSE 375, Rose-Hulman September 11, 2007 Maintenance Code Codetext, Chapter 7Complete, Chapter 24 Complete, Chapter 292 Reverseengineering is the process of analyzing a system to Identify the system's components andinterrelationships C
Rose-Hulman - CSSE - 375
Software User DocumentationDon Bagert CSSE 375, Rose-Hulman October 9, 20061ReferenceSlides 4-11 are mostly taken from the following University of Michigan-Dearborn page:http:/www.engin.umd.umich.edu/CIS/course.des/cis577/lecture/Lec12.htmlCourse In
Rose-Hulman - CE - 489
Sign Up Sheet for Senior Design Project Managers Dr. Houghtalen, Ext. 8449 Wednesday, February 4, 2004 2:30 PM 2:50 3:10 PM 3:40 4:00 PM 4:20
Rose-Hulman - CS - 414
Meeting AgendaMonday, May 05, 2003 Discuss Status of Layton PC Status of XML file Coding Status Bugs Testing Documents Documents in General Do we have them all? Any other Status that may have been missedAction Items by date Yet Another Coding Meeting
Rose-Hulman - TEAM - 374
Software Architecture Documentation for Hardware SuggesterTeam 8: Joshua Hausladen, Amanda Stephan, Joshua Lieberman 2006-02-131. IntroductionThe purpose of this document is to provide a clear, relatively concise outline of the architectural structure
Rose-Hulman - TEAM - 374
Usability: The system should separate the user interface from the rest of the system to avoid having to change the user interface with the implementation. The system will support user initiative and the user will be able to remove their own posts as well
Rose-Hulman - TEAM - 374
Use Case: Rank Advice Actors: Users Pre Conditions: Has made a previously suggested update to his/her computer. Body: 1. User scan shows update has been made. 2. User ranks relevant post by how helpful it really was. 3. Advice-giver's user reliability ran
Rose-Hulman - TEAM - 374
Supplementary Specification for Hardware Recommendation SystemSystem Requirements The following are ranked in order of their importance Usability This project depends on its usability. If users find the site hard to use and/or understand they will stop u
Rose-Hulman - ECE - 380
EC380 Mini Project 4 PeZWork alone for this mini project. You are free to discuss ideas with others. This MATLAB project is part of a sequence of mini projects.Approach Do Lab 11: PeZ - The z, n, and Domains from the CD-ROM.Due Date:This assignment i
Rose-Hulman - CS - 414
Document Inspection Report BURN Tori Bowman, Danielle Claxton, Brandon Invergo, Andy Cooper, Kyle Gossman, Micah Taylor Design Document3/24/03Moderator: Tori Bowman Reader: Danielle Claxton Recorder: Brandon Invergo Producer: Andy Cooper, Micah Taylor,
Rose-Hulman - CS - 414
Sunday Monday1 2 3 JDJ before 1:15pm MAA MAA4 JRH JDJ SSM ICP BGD JRH JDJ SSM ICP SSM ICP BGD JRH JDJ SSM ICP JRH JDJ SSM ICP5 JDJ JWK MST6 BGD JRH JWK SSM ICP MST BGD JRH JWK SSM ICP MST SSM ICP BGD JRH JWK SSM ICP MST BGD JRH JWK SSM ICP MST7 BGD J
Rose-Hulman - CS - 414
Email: Address: Local Phone: Campus Mailbox: IM Name:Mark A. Ardis mark.a.ardis@rose-hulman.edu Library L122 812- 877-8226 CM #119 None (that we know of) Brett G. Dymond brett.g.dymond@rose-hulman.edu 17 N. Fruitridge Ave. Apt #2 812-234-5464 CM1038 IB a
Rose-Hulman - CS - 414
Software Engineering I, Team 8 Union Hospital Linear Accelerator Project Project Meeting, February 10 , 2003 Agenda 1. Review Agenda [1 min] Review and modify this agenda Choose someone to run the next meeting Choose someone to take minutes 2. In Class Pr
Rose-Hulman - CHEM - 270
Name _ Box _ Name _ Box _CM.270 Hands on Exercise # 3 Topic: Glacial Cross-Section in Marion County, Indiana Assignment (Individual report or joint report of a pair.) Due no later than 5 May 2003 - Please budget your own time.The following two items rel
Rose-Hulman - CHEM - 490
Additions and CorrectionsJ. Am. Chem. Soc., Vol. 123, No. 12, 2001 2935Additions and CorrectionsProton-Transfer Reactions between Nitroalkanes and Hydroxide Ion under Non-Steady-State Conditions. Apparent and Real Kinetic Isotope Effects [J. Am. Chem.
Rose-Hulman - CE - 489
CE 489 - CIVIL ENGINEERING DESIGN AND SYNTHESIS Project Descriptions Fall 2006 - Spring 2007Note: All projects will require three written reports, an oral presentation to the class, at least one oral presentation at a public forum, incorporation of multi
Rose-Hulman - CE - 489
Rose-Hulman Institute of Technology Senior Design Project Proposal Farm Animals International-Ghana (Obodan Sustainable Development Center) Client Dr.A.N.AKUNZULE P.O.Box CT 5505 Accra,Ghana Background Information 1. IntroductionAgriculture is the backbo
Rose-Hulman - CSSE - 404
Curt CliftonCSSE404 Compiler ConstructionBasic ParserFor this milestone you will extend your program from the previous milestone to connect a simple parser to your lexical analyzer. I expect that you will use a parser generator tool to construct your p
Rose-Hulman - CSSE - 404
Curt CliftonCSSE404 Compiler ConstructionTerm ProjectPROJECT OVERVIEWYou will be writing a complete compiler for a subset of Java that well call MiniJava.1 You will also be designing and implementing some small extension to MiniJava. Nearly all decisi
Rose-Hulman - EM - 121
EM121: Statics and Mechanics of Materials I Spring 20082009 Project Landing Gear Design Objective: Your objective is to design a lightweight link for a landing gear mechanism that will allow the landing gear to safely retract to a specified angle. Figure
Rose-Hulman - TEAM - 371
Acceptance Test CasesTest Cases for Use Case: Posting a New Article Test Scenario Description Condition: Condition: Case User cancels User previews Id post 1 1 User posts a new No n/a article 2 2 User cancels Yes n/a posting 3 3 User previews No Yes and
Rose-Hulman - CSSE - 371
Midterm Problems from the 2003-2004 CSSE 371 Exam:(Note We make no claim that this year's exam will resemble the one you see here!) 1. Organizing knowledge for a problem: The following problem statement is not in the Function / Form / Economy / Time form
Rose-Hulman - CSSE - 371
CSSE 371Week 8 Day 3 QuizThu October 25 2007Name: _ Mail Box: _1. Why is data analysis important?2. Mention some techniques for analyzing quantitative data.3. Mention some techniques for analyzing qualitative data.4. Given that you will be conducti
Rose-Hulman - CSSE - 371
CSSE 372Week 7 Day 2 QuizTue October 21 2008Name: _ Mail Box: _1. How formal is getting client acceptance of a custom product, and why? 2. Will your project require user documentation? What kind? Why or why not?3. Suppose on the other hand you succe
Rose-Hulman - CSSE - 371
CSSE 371 Fall 2007 Projects to be used in class to demonstrate various requirement specification techniques: To help students understand the various techniques for requirements and specification, we will be using the following projects as a demonstration
Rose-Hulman - CSSE - 371
Lauren Toffolocsse371-Project Use Case4/26/2009Client Description:When the application remains idle (no user interaction, including entering data in text boxes or clicking of links) for a period of 15 minutes, the system will automatically log off the
Rose-Hulman - CSSE - 371
Chapter 22:Developing the Supplemental SpecificationA. Nonfunctional requirements are the most important part of the supplemental spec: 1. These are "Attributes of the system" or its environment and must be managed well, just like functional requirement
Rose-Hulman - CSSE - 371
Brainstorming and StoryboardingSriram Mohan/Steve Chenoweth RHIT Chapters 12 & 13, Requirements Text1Outline Background Barriers to Elicitation Techniques Brainstorming Storyboarding2Three Common Barriers Yes, But Syndrome Develop techniques to
Rose-Hulman - CSSE - 371
Constructing and Analyzing the Project Network DiagramChapter 6CSSE 372 22.Sep.2008OutlineDefinitions Starts Critical path Slack MR ActivityWhat is a network diagram?"A pictorial representation of the sequencein which the project work can be done."
Rose-Hulman - CSSE - 371
Ambiguity, from www.inviolate.com/ max/ambiguity.htm.Ambiguity and SpecificityCSSE 371, Software Requirements and Specification Steve Chenoweth, Rose-Hulman Institute October 19, 2004 In the book This is Ch 23Why are requirements ambiguous? Tom DeMarc
Rose-Hulman - CSSE - 371
CSSE 371 Software Requirements and Specification Fall 2007 Homework 11Due: Thursday, October 25 2007 In Class Purpose: Practice specifying usability goals and user experience goals What to do: 1. Assignment from Chapter 1(Page 37) of Interaction Design t
Rose-Hulman - TEAM - 371
Week 1 Summary for Team 05Dave Bauman Drew Bowman Mike Brandell Matt Salisbury September 12, 2005Effort to Date (in man-hours) Name of Team Member Effort Expended This Week Total Effort to Date Dave Bauman 3.5 3.5 Drew Bowman 2 2 Mike Brandell 2 2 Matt
Rose-Hulman - TEAM - 371
!!"#"$%$ &&'( # # $# () # (#*! ( ($( (( ) # !# , - ./+ $ 01# '#$!"( # # ,!# 1 ' # *#! $ $ ( # 1 , ' & ! $#$ ) %#( # *! !# ! ( ( ( ( # $ #*! ( ( ($'$ (2 ( ( () (% ) $ ( 2 ( 3 ( ( ) ( ( 4 ) ( # 5 # ( # * (% ( * # # $%
Rose-Hulman - CSSE - 371
Left People use these throughout engineering. This ones rom the requirements document at archives.elevated.org/ project/resources.shtm.Some are more precise than othersRequirements DocumentsCSSE 371, Software Requirements and Specification Steve Chenow
Rose-Hulman - TEAM - 371
Team 5 runnermike.com Dave Bauman, Drew Bowman, Mike Brandell, Matt Salisbury Revision HistoryDate 10/6/2005 Version 1.0 Description Initial Draft Edited by Drew BowmanVision Document1 Admissions Applications SolutionThis vision document will be used d
Rose-Hulman - CSSE - 371
The Flatirons in winter Boulder, CO 2004 - From Dean Leffingwell's web site http:/www.leffingwell.org/ What action can you imagine from this image?StoryboardsCSSE 371, Software Requirements and Specification Steve Chenoweth, Rose-Hulman Institute Septem
Rose-Hulman - CSSE - 371
CSSE 371 Team Member Evaluation Form Your Name: _ Team:_ Complete the following evaluation form and turn it in by October 3rd 2007. The information you provide will be confidential and will not be revealed to your team members. If you fail to turn this on
Rose-Hulman - CSSE - 371
Document Contents: All milestone documents produced for this class must include the following sections 1. Title page: This page must contain the teams name and the document title, and must have the signatures of all the team members. A team members signat
Rose-Hulman - BENEFITINF - 051408
EMPLOYEE BENEFIT PROGRAM CHANGES AND ENHANCEMENTS EFFECTIVE JULY 1, 2008HEALTH PLAN Employee contributions will be changed to a 4-Tier structure from the current 3-Tier. The current 1st Tier will be divided such that Tier 1 will encompass those with sala
Rose-Hulman - CSSE - 120
As you arrive:Contact Before Work Start your laptop & enter our Angel course site: angel.rose-hulman.edu csse120 Turn to a neighbor and ask: What do you want to do when you graduate from RoseHulman? Why? Why do Contact Before Work? Helps us know our t
Rose-Hulman - CSSE - 371
CSSE 371Week 5 Day 3 QuizThu October 4 2007Name: _ Mail Box: _1. What is the orthogonal problem?2. How can you solve the orthogonal problem?3. What according to you is software architecture?4. What according to you is Black box testing?5. How do u
Rose-Hulman - CSSE - 371
CSSE371Week5Day2QuizTueOctober72008Name:_MailBox:_1. Whatistheorthogonalproblem?2. Howcanyousolvetheorthogonalproblem?3. Whatissoftwarearchitecture?4. WhatisBlackboxtesting?5. Howdousecaseshelpintesting?6. Howdoyouknowthatyourtestcoverageissuffic
Rose-Hulman - CSSE - 371
CSSE371Week5Day4QuizFriOctober52007Name:_MailBox:_1. Whatisthetraceabilityproblem?2. Whyistraceabilityimportant?3. Howwillyouensuretraceabilityinsoftwaredevelopment?4. AssumeyouareaprojectmanageratIBM.Yourgrouphasbeentaskedwithdevelopinganextgener
NYU - DOCS - 11370
V18.0602-001Cities in Global ContextSpring 2008 Monday and Wednesday 11-12.15 Place TBA Instructor: Anne Rademacher Office: 41 East 11th Street, 7th Floor, Rm 723 Office hours: TBA COURSE DESCRIPTION This course explores contemporary urban processes in