Example of WRAP Operator - SQL
The effect of Example can be obtained in SQL but note that one needs to write down not only the names of the columns being wrapped but also the names and declared types of the columns not being wrapped.
Example: Collecting column values together
SELECT Name, Phone, Email,
CAST (ROW (House, Street, City, Zip) AS
ROW (House VARCHAR (100), Street VARCHAR (100),
City VARCHAR (100), Zip VARCHAR (10)))
As before, we need to use CAST because the result of an invocation of ROW has unnamed fields. The example assumes, therefore, a definition such as the following for the base table CONTACT_INFO:
CREATE TABLE CONTACT_INFO (Name VARCHAR (100) PRIMARY KEY,
Phone VARCHAR (15) NOT NULL,
Email VARCHAR (50) NOT NULL,
House VARCHAR (100) NOT NULL,
Street VARCHAR (100) NOT NULL,
City VARCHAR (100) NOT NULL,
Zip VARCHAR (10) NOT NULL,);
SQL has no shorthand similar neither to WRAP, nor for UNWRAP.