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
Deriving Predicates from Predicates in SQL The corresponding section in the theory book describes how predicates can be derived from predicates using (a) the logical connectiv

Avoid the NOT NULL Constraint In the PL/SQL, using the NOT NULL constraint incur a performance cost. Consider the illustration as shown below: PROCEDURE calc_m IS m NUMB

Relational Operators and Logical Operators It prepares the ground for subsequent sections in which each specific relational operator is paired with its logical counterpart, su

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

What Are Subprograms? The Subprograms are named PL/SQL blocks which can take parameters and be invoked. The PL/SQL has 2 types of subprograms known as the procedure s and func

Example of Cast Operator So long as CAST is used as shown, we could obtain the total marks for each exam in similar fashion, using SUM (Mark) AS TotalMarks. However, this giv

Projection in SQL - correct version Student StudentId is enrolled on some course. SELECT DISTINCT StudentId FROM IS_ENROLLED_ON In more complicated examples it is someti

At times, Brewbean's has changed the id number for existing products. In the past, they have had to add a new product row with the new id to the BB_PRODUCT table, modify all the co

Number Types The Number types permit you to store the numeric data (real numbers, integers, and floating-point numbers), show quantities, and do computations. BINARY_INTEG

First Step at defining type SID in SQL CREATE TYPE SID AS ( C VARCHAR(5) ) ; Explanation: TYPE SID announces that a type named SID is being defined to the syst