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
Example of GROUPBY Operator Example: How many students sat each exam, using GROUP BY, NATURAL LEFT JOIN, and COALESCE SELECT CourseId, COALESCE (n, 0) AS n FROM COURS

EXIT-WHEN The EXIT-WHEN statement permits a loop to complete conditionally. Whenever the EXIT statement is encountered, the condition in the WHEN clause is computed. When the co

Question 1 . Compare SQL and PL/SQL Question 2 . Write a database trigger to implement the following check condition                          Given the following table

Project Description: We organize an online system called ACPAS we have created a project called EVO that can be use by our customers to integrate their web sites with the Acpas

Iteration Schemes The bounds of a loop range can be variables, literals, variables, or expressions but must compute to integers. Below are some of the examples. As you can see t

Using a join on 3 tables, select 5 columns and 10 rows from the 3 tables without the use of a Cartesian product Query: SELECT E.LAST_NAME, E.FIRST_NAME, S.BUILDING, S.BRAN

Use the PLS_INTEGER Datatype When you require to declare an integer variable, use the datatype PLS_INTEGER that is the most efficient numeric type. That is as the PLS_INTEGER

Need Database Development with Analysis Tools Project Description: I want a database for large governmental and private data sets on one country that can be simply extended t

Logical Operators The logical operators AND, NOT, and OR follow the tri-state logic shown in table below. The AND and OR are binary operators; NOT is a unary operator.

SQLs counterpart of the key words: The text from the opening parenthesis to the end of the fourth line specifies the declared type of the table, meaning that every table ever