Reader small image

You're reading from  Oracle Advanced PL/SQL Developer Professional Guide

Product typeBook
Published inMay 2012
Reading LevelExpert
PublisherPackt
ISBN-139781849687225
Edition1st Edition
Languages
Right arrow
Author (1)
Saurabh K. Gupta
Saurabh K. Gupta
author image
Saurabh K. Gupta

Saurabh K. Gupta is a seasoned database technologist with extensive experience in designing high performance and highly available database applications. His technology focus has been centered around Oracle Database architecture, Oracle Cloud platform, Database In-Memory, Database Consolidation, Multitenant, Exadata, Big Data, and Hadoop. He has authored the first edition of this book. He is an active speaker at technical conferences from Oracle Technology Network, IOUG Collaborate'15, AIOUG Sangam, and Tech Days. Connect with him on his twitter handle (or SAURABHKG) or through his technical blog www.sbhoracle. wordpress.com, with comments, suggestions, and feedback regarding this book.
Read more about Saurabh K. Gupta

Right arrow

Working with the CLOB, BLOB, and BFILE data types


By now, we have gathered enough understanding on the LOB data types. We will now see the handling of LOB data in PL/SQL. For illustration purposes, we will use the EMP_LOB_DEMO table, which has been created earlier.

Initializing LOB data type columns

As we learned earlier the LOB column in the table contains only the pointer (LOB locator), while the actual data is stored in the LOB segment. The LOB segment is a different storage area in the same or different tablespace.

For initialization of a LOB data type variable or column, Oracle provides two built-in constructor methods namely, EMPTY_CLOB() and EMPTY_BLOB(). These functions are supported in SQL as well as PL/SQL. The functions assign a default LOB locator to the CLOB and BLOB data type columns or variables. Let us check it out.

The PL/SQL block, shown in the following code snippet, declares a CLOB and BLOB variable and initializes them in the declarative section. However, the initialization...

lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Oracle Advanced PL/SQL Developer Professional Guide
Published in: May 2012Publisher: PacktISBN-13: 9781849687225

Author (1)

author image
Saurabh K. Gupta

Saurabh K. Gupta is a seasoned database technologist with extensive experience in designing high performance and highly available database applications. His technology focus has been centered around Oracle Database architecture, Oracle Cloud platform, Database In-Memory, Database Consolidation, Multitenant, Exadata, Big Data, and Hadoop. He has authored the first edition of this book. He is an active speaker at technical conferences from Oracle Technology Network, IOUG Collaborate'15, AIOUG Sangam, and Tech Days. Connect with him on his twitter handle (or SAURABHKG) or through his technical blog www.sbhoracle. wordpress.com, with comments, suggestions, and feedback regarding this book.
Read more about Saurabh K. Gupta