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

Currval and nextval - sql pseudocolumns, CURRVAL and NEXTVAL The serie...

CURRVAL and NEXTVAL The series is a schema object which generates the sequential numbers. Whenever you form a sequence, you can specify its primary value and an increment. T

Do you know anyone that can do this type of coding or not?, Task 2 [12 mark...

Task 2 [12 marks] Write the package body for the following package specification (the detailed description of each function and procedure is provided in the appendix below). Place

Transaction control, Transaction Control The Oracle is transaction orie...

Transaction Control The Oracle is transaction oriented; that is, Oracle uses the transactions to make sure the data integrity. The transaction is a sequence of SQL data manip

Triffic light control system, write the program for traffic control system ...

write the program for traffic control system with 10 second, 15 secod, and 20 second delay

Laws / rules associated with evolution, LAWS / RULES - Dollo's Law    ...

LAWS / RULES - Dollo's Law                     :           Living organisms do exhibit evolutionary irreversibility or evolution is irreversible. Williston's Law

Theory of biogenesis, THEORY OF BIOGENESIS - This theory explains th...

THEORY OF BIOGENESIS - This theory explains that the existing living organisms originated from pre-existing living beings not from non living entities. This concept of or

Sqls counterpart of the key words, SQLs counterpart of the key words: ...

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

Procedure, 1. Create a procedure called TAX_COST_SP to accomplish the tax c...

1. Create a procedure called TAX_COST_SP to accomplish the tax calculation task. Keep in mind that the state and subtotal values are inputs into the procedure and the procedure is

Keyword and parameter description - forall statement, Keyword &Parameter De...

Keyword &Parameter Description: index_name: This is an undeclared identifier which can be referenced only within the FORALL statement and only as the collection subscript

In out mode - parameter modes, IN OUT Mode An IN OUT parameter passes ...

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

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