|
CS442
- Additional Assignments
|
|
|
Learning Topic #7: Functions Like procedures, functions are also subprograms in SQL. Unlike procedures, functions return a single value as the function name, using the RETURN statement. This topic illustrates the use of functions in SQL. Topic Outcomes Upon completion of this learning topic, the student should be able to: · Create functions in a SQL · Define a function to be used by other SQL blocks · Understand the difference between function declaration and function body · Include parameters to be used by the function · Incorporate exception handling in functions Discussion Questions · Why do we need a function declaration and a function body? · How are functions similar to or different from procedures? · How do we create a function that can be used by other subprograms later on? · How do we define parameters for a function? Suggested Classroom Activities· Define a simple function with no parameters · Add parameters to the previous function · Store the function and call it from another subprogram |
|
Database Programming |