Question: show a user-defined function named FirstNameFirst that concatenates the CustomerLastName and CustomerFirstName into a single value named CustomerName and displays, in order, the CustomerFirstName, space,

  1. show a user-defined function named FirstNameFirst that concatenates the CustomerLastName and CustomerFirstName into a single value named CustomerName and displays, in order, the CustomerFirstName, space, and the CustomerOwnerLastName (Hint: Johnson and Ariel would be combined to read Ariel Johnson).
  2. Code an SQL statement to make an view named CourseEnrollmentFirstNameFirstView that shows CourseNumber, Course, CourseDate, CustomerNumber, CustomerLastName and CustomerFirstName concatenated using the FirstNameFirst user-defined function and displayed as CustomerName, and Phone.
  3. Code an SQL statement that displays the data in CourseEnrollmentLastNameFirstView, sorted alphabetically by CustomerName and CourseNumber.

TABLES:

CUSTOMER (CustomerNumber (PK), CustomerLastName, CustomerFirstName, Phone)

COURSE (CourseNumber (PK), Course, CourseDate, Fee)

ENROLLMENT (CustomerNumber (PK,FK), CourseNumber(PK,FK), AmountPaid)

Here is a picture of what I have written for #1 and the errors I am seeing when trying to compile the code. I think I can figure out 2 and 3 once I get #1 properly working

O C Q A= create or replace FUNCTION FirstNameFirst( CustomerLastName VARCHAR (255) , CustomerFirstName VARCHAR(255) RETURN VARCHAR (255) BEGIN DECLARE CustomerName VARCHAR(255) ; SET CustomerName = CONCAT (CustomerFirstName, ', CustomerLastName) ; 9 RETURN CustomerName; 10 END; 11 12 Results Explain Describe e Saved SQL History Error at line 2: PLS-00103: Encountered the symbol "(" when expecting one of the following : := . ) , @ % default character The symbol ":=" was substituted for "(" to continue. Error at line 5: PLS-00103: Encountered the symbol "(" when expecting one of the following: . @ * ; is default authid as cluster order using external character deterministic parallel_enable pipelined aggregate result_cache accessible rewrite Error at line 3: PLS-00103: Encountered the symbol "(" when expecting one of the following: := . ) , @ % default character The symbol ":=" was substituted for "(" to continue. 1. create or replace FUNCTION FirstNameFirst( 2. CustomerLastName VARCHAR (255) , 3 . CustomerFirstName VARCHAR (255)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Mathematics Questions!