Parameter and keyword description - object types, PL-SQL Programming

Assignment Help:

Parameter and Keyword Description:

type_name:

This identifies a user-defined type specifier that is used in the subsequent declarations of the objects.

AUTHID Clause:

This determines whether all the member methods execute with the rights of their definer (the default) or invoker, and whether their untrained references to schema objects are solved in the schema of the invoker or definer.

attribute_name:

This identifies the object attribute. The name should be exclusive within the object type, however can be reuse in the other object types. You can't initialize an attribute in its declaration by using the assignment operator or DEFAULT clause. Also, you cannot force the NOT NULL constraint on an attribute.

attribute_datatype:

This is any Oracle datatype excluding LONG, LONG RAW, NCLOB, NCHAR, NVARCHAR2, ROWID, the PL/SQL-specific types BINARY_INTEGER, BOOLEAN, PLS_INTEGER, RECORD, REF CURSOR, %TYPE, & %ROWTYPE, and types defined inside the PL/SQL package.

MEMBER | STATIC:

This keyword allows you to state a subprogram or call specification as a method in an object type specification. The method cannot have similar name as the object type or any of its attributes. The MEMBER methods are invoked on instances, which is as shown below:

instance_expression.method()

Though, the STATIC methods are invoked on the object type, not its instances, as shown:

object_type_name.method()

For each of the subprogram specification in an object type specification, there should be an equivalent subprogram body in the object type body. To match specifications and bodies, the compilers do a token-by-token comparison of their headers. Therefore, the headers should match word for word.

The MEMBER methods accept a built-in parameter named SELF that is an instance of the object type. Whether it is declared explicitly or implicitly, it is forever the first parameter passed to a MEMBER method. Though, the STATIC methods cannot accept or reference SELF.

In the method body, the SELF represents the object whose method was invoked. For illustration, the method transform declares SELF as an IN OUT parameter:

CREATE TYPE Complex AS OBJECT (

MEMBER FUNCTION transform (SELF IN OUT Complex) ...

MAP:

This keyword indicate that a method orders objects by mapping them to the values of a scalar datatype like CHAR or REAL, that have a predefined order. The PL/SQL uses the ordering to compute Boolean expressions like x > y, and to do comparisons implied by the GROUP BY, DISTINCT, and ORDER BY clauses. A map method returns the relative place of an object in the ordering of all such objects.

An object type can hold only one map method that should be a parameter less function having the return type NUMBER, DATE, VARCHAR2, or an ANSI SQL type like INTEGER, CHARACTER, or REAL.

ORDER:

This keyword specifies that a method compares two objects. An object type can hold only one order method that should be a function which returns a numeric result.

Every order method takes merely two parameters: the built-in parameter SELF and the other object of the same type. When c1 and c2 are Customer objects, a comparison like c1 > c2 calls method match automatically. The method returns a zero, negative number, or a positive number signifying that the SELF is respectively equal to, less than, or greater than the other parameter. When either parameter passed to an order method is null, and the method returns a null.

subprogram_spec:

This construct declares the interface to the member function or procedure. Its syntax is similar to that of function_spec or procedure_spec without the terminator.

subprogram_body:

This construct defines the underlying implementation of the member function or procedure. Its syntax is similar to that of function_body or procedure_body without the terminator.

call_spec:

This publishes a Java method or the external C function in the Oracle data dictionary. It publishes the practice by mapping its parameter types, name, and return type to their SQL counterparts. 


Related Discussions:- Parameter and keyword description - object types

Create GUIs in PL/SQL, i NEED TO CREATE 3 guiS IN pl/sql sERVER PAGE FORM

i NEED TO CREATE 3 guiS IN pl/sql sERVER PAGE FORM

Wrapping and unwrapping in sql, Wrapping and unwrapping in SQL Operato...

Wrapping and unwrapping in SQL Operators WRAP and UNWRAP in connection with attributes whose declared types are tuple types. Example shows how extension and projection can be

Iterative control:exit statements, EXIT The EXIT statement forces a loop...

EXIT The EXIT statement forces a loop to done unconditionally. Whenever an EXIT statement is encountered, the loop is done immediately and controls the passes to the next statem

Semijoin and composition - sql, Semijoin and Composition - SQL For sem...

Semijoin and Composition - SQL For semijoin, the dyadic relational operator MATCHING, defined thus: r1 MATCHING r2, where r1 and r2 are relations such that r1 JOIN r2 is de

Effects of null, Effects of NULL The numeric variable X, perhaps of ty...

Effects of NULL The numeric variable X, perhaps of type INTEGER, might be assigned NULL. In that case the result of evaluating X + 1 is NULL, and so SET Y = X + 1 assigns NULL

Effects of null for multiple assignments - sql, Effects of NULL for Multipl...

Effects of NULL for Multiple Assignments - SQL If the row expression given as the source for a multiple assignment evaluates to NULL, then NULL is assigned to each target. If

Anatomy of a table, Anatomy of a Table: Figure shows the terminology u...

Anatomy of a Table: Figure shows the terminology used in SQL to refer to parts of the structure of a table. As you can see, SQL has no official terms for its counterpa

Update stock levels, At times, customers make mistakes in submitting their ...

At times, customers make mistakes in submitting their orders and call to cancel the order. Brewbean's wants to create a trigger that automatically updates the stock level of all pr

Tautologies, Tautologies: Above given table allows us to read the trut...

Tautologies: Above given table allows us to read the truth of the connectives in the next manner. Just expect we are looking at row three. It means this says that, if there P

Nested tables versus index-by tables, Nested Tables versus Index-by Tables ...

Nested Tables versus Index-by Tables The Index-by tables and nested tables are just similar. For e.g.  They have similar structure and their individual elements are accessed in

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