A Guide to SQL
A Guide to SQL
9th Edition
ISBN: 9781111527273
Author: Philip J. Pratt
Publisher: Course Technology Ptr
Question
Book Icon
Chapter 8, Problem 8TD
Program Plan Intro

Stored procedures:

  • A procedure is a collection of procedural and SQL statements.
  • A procedure may have input parameter, output parameter and both parameters.
  • It has a declared with a unique named with a unit of procedural code using the proprietary RDBMS and it is invoked by a host language library routine.

Syntax for stored procedure:

CREATE FUNCTION fun_name(argument IN data-type)RETRUN data-type[IS]

BEGIN

    PL/SQL statements;

    Return (value or expression);

END;

Blurred answer
Students have asked these similar questions
This question should be answered in PL/SQL only!   Create a procedure that takes instructor_ID as a parameter. Name it INSTR_SECTIONS. The procedure displays instructor first and last names, and also a list of sections that the instructor is scheduled to teach. Only one instructor per procedure call. You give/pass to a procedure instructor_ID as a parameter, the procedure prints INFO related only to that instructor.
By using this table answer this question in SQL : Write a SQL query, which shows a list of all employees last name, their department names and their department city where that department is located from the employees table.  If an employee does not belong to a department, then their department number and department name should show as “N/A” and their department city should show up as  “No City info Found”.  MAKE SURE you have all the employees displayed including the employees who do not have a department.
Write a stored procedure in MySQL, PL/SQL, or T-SQL that changes the price of an item with a given item ID. How would you use this stored procedure to change the price of item AD72 to $84.99?
Knowledge Booster
Background pattern image
Similar questions
Recommended textbooks for you
  • Text book image
    A Guide to SQL
    Computer Science
    ISBN:9781111527273
    Author:Philip J. Pratt
    Publisher:Course Technology Ptr
Text book image
A Guide to SQL
Computer Science
ISBN:9781111527273
Author:Philip J. Pratt
Publisher:Course Technology Ptr