Question
Create a package that uses packaged variables to assist in the user logon process. When a returning shopper logs on, the username and password entered
Create a package that uses packaged variables to assist in the user logon process. When a returning shopper logs on, the username and password entered will need to be verified against the database. In addition, two values need to be stored in packaged variables for reference during the user session: the shopper ID and the first three digits of the shopper's zip code (used for regional advertisements displayed on the site).
Create a function that accepts a username and password as arguments and verifies these values against the database for a match. If a match is found, return the value Y. Set the value of the variable holding the return value to N. Include a NO_DATA_FOUND exception handler to display a message that the logon values are invalid.
Use an anonymous block to test the procedure, using the username gma1 and the password goofy.
Now place the function in a package, and add code to create and populate the packaged variables specified earlier. Name the package LOGIN_PKG.
Use an anonymous block to test the packaged procedure, using the username gma1 and the password goofy to verify that the procedure works correctly.
Use DBMS_OUTPUT statements in an anonymous block to display the values stored in the packaged variables.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started