Example of wrap operator - sql, PL-SQL Programming

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 Address

FROM CONTACT_INFO

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.

Posted Date: 1/18/2013 7:00:15 AM | Location : United States







Related Discussions:- Example of wrap operator - sql, Assignment Help, Ask Question on Example of wrap operator - sql, Get Answer, Expert's Help, Example of wrap operator - sql Discussions

Write discussion on Example of wrap operator - sql
Your posts are moderated
Related Questions
How do I display usernames for students from a student table, assigning each student a username initials001 (initials is the actual student initials), and if the students initials

Data Abstraction The Data abstraction extracts the important properties of data while ignoring the not necessary details. Once you design a data structure, you can fail to reme

Need Azure CRM Web Application with two-factor authentication We presently have a CRM-like database stored on MS Azure that we presently access over an MS Access application. It

Overview of control structures According to the structure theorem, any computer program can be written by using the basic control structures as shown in figure below. They can b

Manipulating Collections Within PL/SQL, the collections add procedural power and flexibility. The biggest benefit is that your program can compute subscripts to process the spec

THEO R Y OF SPECIAL CREATION - Life originated on the earth due to natural events by the super natural power. The biblical story of creation of world within six days was p

IN OUT Mode An IN OUT parameter passes initial values to the subprogram being called and return efficient values to the caller. Within the subprogram, an IN OUT parameter acts

Define basic operators of relational algebra with an example each

Application to Export Excel Data to MSSQL Server table I am having a table available in excel format and features the subsequent: - Some text is in Arabic (e.g. UTF-8 encodin

Example of UNWRAP Operator - SQL Example here shows how unwrapping can be done in longhand in SQL. Example: Unwrapping in SQL Letting CONTACT_INFO_WRAPPED denote the res