Example of wrap operator - sql, PL-SQL Programming

Assignment Help:

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.


Related Discussions:- Example of wrap operator - sql

%isopen - implicit cursor attributes, %ISOPEN The Oracle closes the SQ...

%ISOPEN The Oracle closes the SQL cursor automatically after executing its related SQL statement. As a result, the %ISOPEN forever yields FALSE.

Passing cursor parameters, Passing Cursor Parameters You use the OPEN ...

Passing Cursor Parameters You use the OPEN statement to pass the parameters to a cursor. Unless you want to accept the default values, each proper parameter in the cursor decl

Example of coalesce operator - sql, Example of COALESCE operator Examp...

Example of COALESCE operator Example: Give the total of marks for each exam (simplified solution) SELECT CourseId, COALESCE ((SELECT SUM (Mark) FROM EXAM_MARK AS EM

Dynamic ranges- iterative control, Dynamic Ranges The PL/SQL lets you det...

Dynamic Ranges The PL/SQL lets you determine the loop range dynamically at run time, as the example below shows: SELECT COUNT(empno) INTO emp_count FROM emp; FOR i IN 1..emp_cou

Features of pl/sql, Main features of PL/SQL A good way to get familiar ...

Main features of PL/SQL A good way to get familiar with PL/SQL is to look at a sample program. The below program processes an order for tennis rackets. At first, it declares a

Translate the given er schema into sql, Consider the schema for FreeCheckin...

Consider the schema for FreeChecking Bank, that we designed given below. Translate the given ER schema into SQL CREATE TABLE statements (indicating primary key, unique and foreign

Using exists - collection methods, Using EXISTS The EXISTS(n) returns ...

Using EXISTS The EXISTS(n) returns TRUE if the nth element in a collection exist. Or else, EXISTS(n) returns FALSE. Primarily, you use EXISTS with DELETE to maintain the spars

PROCEDURE, Create a procedure named DDPROJ_SP that retrieves project inform...

Create a procedure named DDPROJ_SP that retrieves project information for a specific project based on a project ID. The procedure should have two parameters: one to accept a projec

Assignment statement in pl sql, Assignment Statement: The assignment s...

Assignment Statement: The assignment statement sets the present value of the variable, parameter, field, or element. The statement consists of an assignment target followed by

Write an anonymous block that contains a pl/sql procedure, Write an anonymo...

Write an anonymous block that contains a PL/SQL procedure. The procedure takes two input parameter: oldZip and newZip, and it updates the zipcodes table by replacing all oldZip wit

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd