RelationalDBDesign
SiteMap
PL/SQL
Stored Objects
PL/SQL Programming
Control Structures
«Prev
Next»
Programming PL/SQL Objects
Declaring PL/SQL Variables
Common Tools PL/SQL
PL/SQL Variables
Variable Data Types
PL/SQL var bind host
DBMS Output Line
Creating Naming Convention
Building Queries PL/SQL
PL/SQL Datatypes
PL/SQL Block Guidelines
Variables Nested Blocks
Block Identifiers Literals
Adding PL/SQL Comments
Implicit Datatype Conversions
Operators in PL/SQL
PL/SQL Block Conclusion
PL/SQL Datatypes - Quiz
Writing Control Structures
If-then Else
Using If Clause
if then-else syntax
PL/SQL Begin Loop
For/While Loops
Labels Goto Statement
PL/SQL Control Structures
Control Structures - Quiz
Composite Datatypes
PL/SQL Table Structure
PL/SQL Record
Row Type Attributes
Composite Types Summary
Using Explicit Cursors
What is Cursor
Implicit Cursors
Explicit Cursors
CursorBlock Structure
Open Cursor Fetch Records
Close Cursor
Building Cursor Block
for Loop Cursor
Cursor Block Conclusion
PL/SQL Exceptions
PL/SQL Exception
Exception Types
Handling Predefined Exceptions
User Defined Exceptions
Raise Explicit Exceptions
Function Exceptions
PL/SQL Error Handling
PL/SQL Block Goto Statement - Exercise
Create a PL/SQL block with labels and a GOTO statement
Objective:
Identify the use of labels and the GOTO statement.
Exercise Scoring
This exercise is worth a total of 25 points. You will receive up to 10 points for submitting the correct code to build the PL/SQL block using labels and the
GOTO
statement. You will receive up to 10 points for submitting the code without using labels and the
GOTO
statement. You will receive up to 5 points for explaining which you prefer and why.
Background | Overview
e-pet.com has hired you for your PL/SQL skills. Before the store can sell pets online, it requires your immediate assistance to build a PL/SQL block that will look for the last pet product sold and list the first name of the customer who purchased it.
Instructions
Use the
SALES_DATE
field from the CUSTOMER_SALE table to identify the latest pet product sold.
Use the
FIRSTNAME
field from the CUSTOMER table to get the name of the customer.
Build this block using labels and the
GOTO
statement.
Build this block without the use of labels and the
GOTO
statement.
Explain what style of code you prefer and why.
Download files
Download the PETSTORE schema files from the following link.
Submitting your exercise
Once you have written your PL/SQL block, place it in the text area below and click the
Submit
button to submit the exercise.
Submit