Lob types in pl/sql, PL-SQL Programming

Assignment Help:

LOB Types

The large object (LOB) datatypes like BFILE, BLOB, CLOB, and NCLOB store the blocks of unstructured data (like graphic images, text, video clips, and sound waveforms) of up to four gigabytes in size. And, they allow random, efficient, piece-wise access to the data.

The LOB types are differing from the LONG and LONG RAW types in many ways. For example, the LOBs (except NCLOB) can be the attributes of an object type, but LONGs cannot. The maximum size of a LOB is 4 gigabytes, but the maximum size of a LONG is 2 gigabytes. The LOBs also support random access to data, but LONGs support only the sequential access.

BFILE

You use the BFILE datatype to store the large binary objects in an operating system files outside the database. Every BFILE variable stores a file locator that points to a large binary file on the server. The locator involves a directory alias that specifies a full path name.

The BFILEs are read-only. You cannot modify or change them. The size of a BFILE is system dependent but cannot exceed 4 gigabytes (2**32 - 1 bytes). Your DBA makes sure that a given BFILE exists and that Oracle has read permissions on it. The underlying operating system maintains the file integrity.

The BFILEs do not participate in transactions, are not recoverable, and cannot be simulated. The highest number of open BFILEs is set by the Oracle initialization parameter SESSION_MAX_OPEN_FILES, that is system dependent.

BLOB

You use the BLOB datatype to store the large binary objects in the database in-line or out-of-line. Each BLOB variable stores a locator, thatpoints to a large binary object. The size of a BLOB cannot exceed 4 gigabytes. The BLOBs participate fully in transactions, and are recoverable, and can replicate. The Changes made by package DBMS_LOB or the OCI can be committed or rolled back. Though, the BLOB locators cannot span transactions or sessions.

CLOB

You use the CLOB datatype to store the large blocks of single-byte character data in the database, in-line or out-of-line. Both the fixed-width and variable-width character sets are supported. Each CLOB variable stores a locator that points to a large block of character data. The size of a CLOB cannot exceed 4 gigabytes. The CLOBs participate fully in transactions, and are recoverable, and can be replicated. The Changes made by package DBMS_LOB or the OCI can be committed or rolled back. Though, the CLOB locators cannot span transactions or sessions.

Other Types

The following types permit you to store and manipulate the logical values and date/time values.

BOOLEAN

You use the BOOLEAN datatype to store the logical values like TRUE, FALSE, & NULL. The BOOLEAN datatype takes no parameters. Only the values TRUE, FALSE, & NULL can be assigned to a BOOLEAN variable. You cannot insert the values like TRUE & FALSE into a database column. You cannot also select or fetch the column values into a BOOLEAN variable.

DATE

You use the DATE datatype to store the fixed-length date/time values. The DATE values involve the time of day in seconds since the midnight. The date portion defaults to the first day of the present month; the time portion defaults to midnight. The date function SYSDATE returns the present date and time.

For illustration, the following statement returns the number of days since an employee was hired:

SELECT SYSDATE - hiredate INTO days_worked FROM emp WHERE empno = 7499;


Related Discussions:- Lob types in pl/sql

Enforce security in the database system, Question: (a) In the context o...

Question: (a) In the context of database security explain how the following database features help to enforce security in the database system: (i) Authorisation (ii) Access

Functions in pl/sql, Functions   The function is a subprogram that cal...

Functions   The function is a subprogram that calculates a value. The Functions and procedures are structured similar, except that the functions have a RETURN clause. You can

Compare sql and pl/sql, Question 1 . Compare SQL and PL/SQL Question 2 ...

Question 1 . Compare SQL and PL/SQL Question 2 . Write a database trigger to implement the following check condition                          Given the following table

Out mode - parameter modes, OUT Mode An OUT parameter returns values t...

OUT Mode An OUT parameter returns values to the caller of a subprogram. Within the subprogram, an OUT parameter act like a variable. That means that you can use an OUT formal

Level - sql pseudocolumns, LEVEL You use the LEVEL with the SELECT CON...

LEVEL You use the LEVEL with the SELECT CONNECT BY statement to categorize rows from a database table into a tree structure. The LEVEL returns the level number of a node in a

Cursors - syntax, Cursors   To execute the multi-row query, the Oracle...

Cursors   To execute the multi-row query, the Oracle opens an unnamed work region which stores the processing information. The cursor names the work region, access the informa

Cartesian product, Using a Join on 2 tables, select all columns and all row...

Using a Join on 2 tables, select all columns and all rows from the tables without the use of a Cartesian product. Query: SELECT * FROM EMPLOYEE1 JOIN CONTRACT ON EMPLOYEE

Inner join, Inner Join We have learned how to retrieve data from one t...

Inner Join We have learned how to retrieve data from one table by using SELECT statement. But, as we have learned, normalized relational databases mean the data is spread betw

If statement - syntax, IF Statement The IF statement executes a series ...

IF Statement The IF statement executes a series of statement conditionally. Whether the series is executed or not depends on the value of the Boolean expression. Syntax:

Map and order methods, Map and Order Methods: The values of the scalar...

Map and Order Methods: The values of the scalar datatype like CHAR or REAL have a predefined order that allows them to be compared. While, the instances of an object type has

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