Chapter 10B – Managing Databases with Oracle Database
Page 10B-131
E. Create and test a user-defined function named CityStateZIP that combines three
parameters named City, State, and ZIP into a concatenated name field formatted City,
State ZIP (including the comma and the spaces).
Solutions are below and in the file DBP-e15-Oracle-QACS-Create-Views-and-Functions.sql.
CREATE OR REPLACE FUNCTION CityStateZIP
Tested in view that follows in part F.
F. Create and test a view called CustomerMailingAddressView that contains the customer
name concatenated and formatted as FirstName LastName in a field named
CustomerName, the customer’s street address in a field named CustomerStreetAddress,
and the customer’s City, State, ZIP concatenated and formatted as City, State ZIP in a
field named CustomerCityStateZIP.
Solutions are below and in the file DBP-e15-Oracle-QACS-Create-Views-and-Functions.sql.