Question

Create Function in (PL/SQL) called lookup_user (v_email) Return the user number of the given user or...

Create Function in (PL/SQL)

called lookup_user (v_email)

Return the user number of the given user or -1 if the user is not found.

Table Account (this is the table I need to add data using Function)

Account_no (PK)

Email (VARCHAR2)

first (VARCHAR2)

last (VARCHAR2)

Homework Answers

Answer #1

Table has been created and data inserted

PL SQL Function code

Return the user number of the given user if user is found   (Code and output as screenshot)

Return -1 if the user is not found (Code and output as screenshot)

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
Create a user-defined function in SQL to return a valid query author and date. This will...
Create a user-defined function in SQL to return a valid query author and date. This will be used for all views later on in future queries.
3. How many people have the last name King Use PL/SQL? Code: Output: 4. Change the...
3. How many people have the last name King Use PL/SQL? Code: Output: 4. Change the first name to Stephen for the person with the last name King Use PL/SQL. Code: Output: Copy the record showing name change: Code: Output: 5. Delete all employees in Department 20. Use %TYPE for the variable. Use SQL%ROWCOUNT to see how many records were deleted. Code: Copy output showing ROWCOUNT: 6. Use a merge to merge the original employees table into emp_test. Do UPDATE...
• First, create a function called addNumber, which has a formal parameter for an array of...
• First, create a function called addNumber, which has a formal parameter for an array of integers and increase the value of each array element by a random integer number between 1 to 10. o Add any other formal parameters that are needed. • Second, create another function called printReverse that prints this array in reverse order. • Then, you need to write a C++ program to test the use of these two functions.
C++ Create an empty vector in main called theVect. Ask the user for a number. Fill...
C++ Create an empty vector in main called theVect. Ask the user for a number. Fill the vector with 10 random numbers that are multiples of that number. So, for instance, if the user says 7, then you need to use a while loop and fill in the vector with any randomly generated number that is num % 7.
Using C programming Create a function called printMenu( ) with the following properties: Has no function...
Using C programming Create a function called printMenu( ) with the following properties: Has no function inputs or output. Prints the following menu to the screen: 1. Enter user name. 2. Enter scores. 3. Display average score. 4. Display summary. 5. Quit Create a function called printLine( ) with the following properties: Takes as input a char Takes as input an integer corresponding to the number of times to print the character Has no function output. For example, if we...
Write a function called char_counter that counts the number of a certain character in a text...
Write a function called char_counter that counts the number of a certain character in a text file. The function takes two input arguments, fname, a char vector of the filename and character, the char it counts in the file. The function returns charnum, the number of characters found. If the file is not found or character is not a valid char, the function return -1. As an example, consider the following run. The file "simple.txt" contains a single line: "This...
Create a file called artists.js (or a node project) that will scrape the provided url:"url" and...
Create a file called artists.js (or a node project) that will scrape the provided url:"url" and send an email of all artists & songs that are sung by the specified artists given via the command line. Requirements: • The specified artists must be read in via the command line • If no artist(s) are specified do not send an email • If the specified artist(s) are not found on the website, do not send an email • If the specified...
Create a program that allows the user to input a list of first names into one...
Create a program that allows the user to input a list of first names into one array and last names into a parallel array. Input should be terminated when the user enters a sentinel character. The output should be a list of emial addresses where the address is of the following form: [email protected] Declare FirstName[100] as String Declare LastName[100] as String Declare email as String Declare K as Integer Declare index as Integer Write "Enter first and last name." Write...
Save your select statements as a script. Place the semicolon at the end of each SQL...
Save your select statements as a script. Place the semicolon at the end of each SQL statement. Please number your select statements from 1 to 8 in your script and comment out each number. Include your name and student number as a comment at the top of your script. The name of the script has to be Assignment1_JohnSmith. Instead of JohnSmith use your First Name and Last Name. Upload your script trough Blackboard. Use SQL Developer to create the My...
A. Create a PowerShell script named “restore.ps1” within the “Requirements2” folder. For the first line, create...
A. Create a PowerShell script named “restore.ps1” within the “Requirements2” folder. For the first line, create a comment and include your first and last name along with your student ID. Note: The remainder of this task shall be completed within the same script file, “restore.ps1.” B. Write a single script within the “restore.ps1” file that performs all of the following functions without user interaction: 1. Create an Active Directory organizational unit (OU) named “finance.” 2. Import the financePersonnel.csv file (found...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT