First step at defining type sid in sql, PL-SQL Programming

Assignment Help:

First Step at defining type SID in SQL

CREATE TYPE SID AS ( C VARCHAR(5) ) ;

Explanation:

  1. TYPE SID announces that a type named SID is being defined to the system.
  2. AS ( C VARCHAR(5) ) defines SID as a structured type, whose values are represented as a structure consisting in this case of just a single attribute, named C, of type VARCHAR(5). (The term attribute here is not be confused with its use in relational theory.) The attribute definition C VARCHAR(5) causes an operator to come into existence that takes a value, of type SID and returns the value of the C component of s. The operator, SQL's counterpart of THE_C, is invoked using dot notation: s.C and is termed the observer function for the component C.

So-called constructor function, in this case a niladic operator named SID, is generated by the structure definition, such that SID() denotes the value of type SID whose only component is the "default value" for the attribute C, probably NULL. SID selector we need to use the so-called mutator function for the attribute C, which is also invoked using dot notation: SID().C('S1'). The mutator function takes a value of type SID as its left operand and a value of the declared type of C as its right operand (in parentheses). In general, if s is a value of type SID, then s.C('S1') denotes the SID value that is obtained from s by replacing its C component by the string 'S1'. If s had any other components (it doesn't, of course), they would be retained in s.C('S1'). By the way, don't be misled by the term "mutator": an SQL mutator function is a read-only operator.


Related Discussions:- First step at defining type sid in sql

Create Tables, Hi there, I have the final part of a submission to do, it ...

Hi there, I have the final part of a submission to do, it is a demonstration that takes place tomorrow. I do not have to use previous information, but i have resources that sho

Update the Status of an Ordere, Create a procedure named STATUS_SHIP_SP tha...

Create a procedure named STATUS_SHIP_SP that allows a company to employee in the Shipping Department to update the status of an order to add shipping information. The BB_BASKETSTAT

I need sql to infopath data connection, I need SQL to infopath data connect...

I need SQL to infopath data connection Project Description: Want data retrieval connection from SQL to SharePoint infopath Skills required are Sharepoint, SQL

Manipulating local collections - pl/sql, Manipulating Local Collections ...

Manipulating Local Collections Within PL/SQL, to manipulate the local collection, by using the  TABLE and CAST operators . The operands of CAST are a collection declared locally

Compare sql and pl/sql, Question 1 . Compare SQL and PL/SQL Question 2 ...

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

Map and order methods, Map and Order Methods: The values of the scalar...

Map and Order Methods: The values of the scalar datatype like CHAR or REAL have a predefined order that allows them to be compared. While, the instances of an object type has

Best practices/Data Warhousing, What are 3 good practices of modeling and/o...

What are 3 good practices of modeling and/or implementing data warehouses?

Iteration schemes- iterative control, Iteration Schemes The bounds of a ...

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

Updating by replacement, Updating by replacement Syntax: UPDAT...

Updating by replacement Syntax: UPDATE ENROLMENT SET Name = 'Ann' WHERE StudentId = SID ('S1'); Note the use of SET, as already noted in connection with direct a

%rowtype - cursors, %ROWTYPE: This attribute gives a record type which ...

%ROWTYPE: This attribute gives a record type which represents a row in the database table or a row fetched from a formerly declared cursor. The Fields in the record and corresp

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