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

Second Step at defining type SID in SQL

CREATE TYPE SID AS VARCHAR(5) ;

Explanation:

  1. TYPE SID announces that a type named SID is being defined to the system.
  2. AS VARCHAR(5) defines SID as a distinct type, whose values are represented by values of type VARCHAR(5). In this form of type definition the given representation must be a system- defined type.

Under this definition, SID('S1') is exactly equivalent to the same expression in Tutorial D, and the SQL expression CAST(s AS VARCHAR(5)), where s is a value of type SID, is equivalent to Tutorial D's THE_C(s). However, we have no way of further constraining the string values representing student identifiers; so SID('34x.1'), for example, also denotes a value of type SID, as does SID(' ').

Posted Date: 1/18/2013 2:39:32 AM | Location : United States







Related Discussions:- Second step at defining type sid in sql, Assignment Help, Ask Question on Second step at defining type sid in sql, Get Answer, Expert's Help, Second step at defining type sid in sql Discussions

Write discussion on Second step at defining type sid in sql
Your posts are moderated
Related Questions
Aggregate Assignment The %ROWTYPE declaration cannot include an initialization clause. Though, there are two ways to assign values to all fields in a record at once. At First, t

INSERT Statement The INSERT statement adds fresh rows of data to the specified database table or view. Syntax:

V ariables and Constants in PL/SQL The PL/SQL permits you to declare constants and variables, and then use them in SQL and procedural statements anywhere in the expression. Th

Cause of Indeterminacy in SQL One root cause of indeterminacy in SQL lies in its implementation of comparison for equality. For certain system-defined types it is possible for

Declaring Cursor Variables Once a REF CURSOR type is define by you, and then you can declare the cursor variables of that type in any PL/SQL block or subprogram. In the exampl

SELECT a.child_fname,a.child_lname,concat(b.parent_title,b.parent_fname), b.parent_lname,b.parent_tphone FROM child a,parent b WHERE a.parent_id=b.parent_id ORDER BY a.child_fnam

Organi c Evolution Evolution is a slow continuous, irreversible and natural process of change to give rise to advance and diverse forms of life i.e. formation of new specie

MILLER-UREY' S EXPERIMENTAL PROCEDURES - They recreated the probable conditions on the primitive earth in the laboratory. An atmosphere containing hydrogen, ammonia, me

Using COMMIT The COMMIT statements end the present transaction and make permanent any changes made during that transaction. Till you commit the changes, other users cannot acc

Exceptions An exception is the runtime error or warning condition that can be predefined or user-defined. The Predefined exceptions are raised implicitly through runtime system