Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask PL-SQL Expert

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. 

PL-SQL, Programming

  • Category:- PL-SQL
  • Reference No.:- M9510698

Have any Question?


Related Questions in PL-SQL

For this assignment you will be provided a database backup

For this assignment, you will be provided a database backup for a database called FinanceDB. You will have to restore this backup to your own version of SQL Server. All of the questions in this assignment relate to the F ...

Complete the following tasksin microsoft access create the

Complete the following tasks: In Microsoft Access, create the database and tables that you identified in W3 Assignment 2. In Microsoft Word, write the SQL statements to create the database and tables. Write SQL statement ...

Assignment - queries functions and triggersaimthe aims of

Assignment - Queries, Functions and Triggers Aim The aims of this assignment are to: formulate SQL queries; populate an RDBMS with a real dataset, and analyse the data; design test data for testing SQL queries; create SQ ...

Continuing the project you have worked on in weeks 1-4 in

Continuing the project you have worked on in Weeks 1-4, in this final week, complete the following tasks: Refine your database and SQL statements by incorporating your instructor's feedback. Verify that the database comp ...

Purpose of the assessment with ulo mapping the purpose of

Purpose of the assessment (with ULO Mapping) The purpose of this assignment is to develop skills in managing data in databases and to gain understanding of data model development and implementation using a commercially a ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As