Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask PL-SQL Expert

ROWID and UROWID

Internally, every database table has a ROWID pseudo column that stores binary values known as rowids. Each rowid shows the storage address of a row. A physical rowid identify a row in an ordinary table. A logical rowid identify a row in an index-organized table. The ROWID datatype can store only physical rowids. Thgough, the UROWID (the universal rowid) datatype can store logical,physical, or foreign (non-Oracle) rowids.

Physical Rowids

The Physical rowids provide a fast access to the particular rows. As long as the row exists, its physical rowid does not change. The Efficient & stable, physical rowids are very useful for selecting a set of rows, operating on the entire set, and then updating a subset. For e.g. , you can compare a UROWID variable with the ROWID pseudocolumn in the WHERE clause of an UPDATE or DELETE statement to identify the newest row fetched from a cursor.

Logical Rowids

The Logical rowids provide the fastest access to the particular rows. The Oracle uses them to construct the secondary indexes on index-organized tables. Having no permanent physical address, a logical rowid can move across the data blocks when new rows are inserted. Though, if the physical location of a row changes, its logical rowid remain valid.

VARCHAR2

You use the VARCHAR2 datatype to store the variable-length character data. How the data is represented internally is totally depend on the database character set. The VARCHAR2 datatype takes a required parameter that specifies the maximum length of up to 32767 bytes. The syntax is as shown below:

VARCHAR2(maximum_length)

You cannot use a constant or variable to specify the highest length; you should use an integer literal in the range 1 to 32767.

The VARCHAR2 datatype includes a trade-off between efficiency and memory use. For a VARCHAR2(>= 2000) variable, the PL/SQL dynamically allocates only enough memory to hold the actual value. Though, for a VARCHAR2 (< 2000) variable, the PL/SQL pre allocates enough memory to hold a maximum-size value.

VARCHAR2 Subtypes

The VARCHAR2 subtypes shown below have the same range of values as their base type. For illustration, the VARCHAR is just another name for VARCHAR2.

STRING

VARCHAR

NLS Character Types

Though the widely used 7- or 8-bit ASCII and EBCDIC character sets are sufficient to represent the Roman alphabet, some Asian languages, like Japanese, contain many characters. These languages need 16 bits (two bytes) to represent each character. How does Oracle deal with such unlike languages?

The Oracle provides National Language Support (NLS) that process single-byte & multi-byte character data and convert between the character sets. It also lets your applications run in various language environments.

NCHAR

You use the NCHAR datatype to store the fixed-length NLS character data. How the data is represented internally, totally depends on the national character set, which might use a fixed-width encoding like US7ASCII or a variable-width encoding like JA16SJIS. The NCHAR datatype takes an optional parameter that specifies the highest length of up to 32767 bytes. The syntax is as shown below:

NCHAR[(maximum_length)]

You cannot use a variable or constant to specify the maximum length; you must use an integer literal in the range 1 to 32767.

NVARCHAR2

You use the NVARCHAR2 datatype to store the variable-length NLS character data. How the data is represented internally totally depends on the national character set, that might use a fixed-width encoding like WE8EBCDIC37C or a variable-width encoding like JA16DBCS. The NVARCHAR2 datatype takes a required parameter which specifies a maximum length of up to 32767 bytes. The syntax is as shown below:

NVARCHAR2(maximum_length)

You cannot use a variable or constant to specify the maximum length; you must use an integer literal in the range 1 to 32767.

PL-SQL, Programming

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

Have any Question?


Related Questions in PL-SQL

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 ...

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 ...

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