A LOB Demonstration Files

This appendix describes files distributed with the database that demonstrate how LOBs are used in supported programmatic environments. This appendix contains these topics:

A.1 PL/SQL LOB Demonstration Files

The following table lists PL/SQL demonstration files. These files are installed in $ORACLE_HOME/rdbms/demo/lobs/plsql/. A driver program, lobdemo.sql, that calls these files is found in the same directory.

Table A-1 PL/SQL Demonstration Examples

File Name Description Usage Information

fclose_c.sql

Closing a BFILE with CLOSE

Closing a BFILE with CLOSE

fclose_f.sql

Closing a BFILE with FILECLOSE

Closing a BFILE with FILECLOSE

fclosea.sql

Closing all open BFILEs

Closing All Open BFILEs with FILECLOSEALL

fcompare.sql

Comparing all or parts of two BFILEs

Comparing All or Parts of Two BFILES

fcopyloc.sql

Copying a LOB locator for a BFILE

About Assigning a BFILE Locator

fdisplay.sql

Displaying BFILE data

About Displaying BFILE Data

fexists.sql

Checking if a BFILE exists

Determining Whether a BFILE Exists

ffilopen.sql

Opening a BFILE with FILEOPEN

About Opening a BFILE with FILEOPEN

ffisopen.sql

Checking if the BFILE is OPEN with FILEISOPEN

About Determining Whether a BFILE Is Open with FILEISOPEN

fgetdir.sql

Getting the directory object name and filename of a BFILE

Getting Directory Object Name and File Name of a BFILE

finsert.sql

Inserting row containing a BFILE by initializing a BFILE locator

About Inserting a Row Containing a BFILE

fisopen.sql

Checking if the BFILE is open with ISOPEN

About Determining Whether a BFILE Is Open Using ISOPEN

flength.sql

Getting the length of a BFILE

Getting the Length of a BFILE

floadlob.sql

Loading a LOB with BFILE data

About Loading a LOB with BFILE Data

fopen.sql

Opening a BFILE with OPEN

About Opening a BFILE with OPEN

fpattern.sql

Checking if a pattern exists in a BFILE using instr

Checking If a Pattern Exists in a BFILE Using INSTR

fread.sql

Reading data from a BFILE

About Reading Data from a BFILE

freadprt.sql

Reading portion of a BFILE data using substr

About Reading a Portion of BFILE Data Using SUBSTR

fupdate.sql

Updating a BFILE by initializing a BFILE locator

About Updating a BFILE by Initializing a BFILE Locator

lappend.sql

Appending one LOB to another

About Appending One LOB to Another

lcompare.sql

Comparing all or part of LOB

Comparing All or Part of Two LOBs

lcopy.sql

Copying all or part of a LOB to another LOB

Copying All or Part of One LOB to Another LOB

lcopyloc.sql

Copying a LOB locator

Copying All or Part of One LOB to Another LOB

ldisplay.sql

Displaying LOB data

About Displaying LOB Data

lerase.sql

Erasing part of a LOB

About Erasing Part of a LOB

linsert.sql

Inserting a row by initializing LOB locator bind variable

Inserting a Row by Initializing a LOB Locator Bind Variable

linstr.sql

Seeing if pattern exists in LOB (instr)

Patterns: Checking for Patterns in a LOB Using INSTR

lisopen.sql

Seeing if LOB is open

Determining Whether a LOB is Open

listemp.sql

Seeing if LOB is temporary

Determining Whether a LOB instance Is Temporary

lldblobf.sql

Using DBMS_LOB.LOADBLOBFROMFILE to load a BLOB with data from a BFILE

About Loading a BLOB with Data from a BFILE

lldclobf.sql

Using DBMS_LOB.LOADCLOBFROMFILE to load a CLOB or NCLOB with data from a BFILE

Loading a CLOB or NCLOB with Data from a BFILE

lldclobs.sql

Using DBMS_LOB.LOADCLOBFROMFILE to load segments of a stream of data from a BFILE into different CLOBs

Loading a CLOB or NCLOB with Data from a BFILE

llength.sql

Getting the length of a LOB

Length: Determining the Length of a LOB

lloaddat.sql

Loading a LOB with BFILE data

Loading a LOB with Data from a BFILE

lobuse.sql

Examples of LOB API usage.

Creating Persistent and Temporary LOBs in PL/SQL

lread.sql

Reading data from LOB

About Reading Data from a LOB

lsubstr.sql

Reading portion of LOB (substr)

Reading a Portion of a LOB (SUBSTR)

ltrim.sql

Trimming LOB data

About Trimming LOB Data

lwrite.sql

Writing data to a LOB

About Writing Data to a LOB

lwriteap.sql

Writing to the end of LOB (write append)

About Appending to a LOB

A.2 OCI LOB Demonstration Files

The following table lists OCI demonstration files. These files are installed in $ORACLE_HOME/rdbms/demo/lobs/oci/. A driver program, lobdemo.c, that calls these files is found in the same directory, as is the header file lobdemo.h.

Table A-2 OCI Demonstration Examples

File Name Description Usage Information

fclose_c.c

Closing a BFILE with CLOSE

Closing a BFILE with CLOSE

fclose_f.c

Closing a BFILE with FILECLOSE

Closing a BFILE with FILECLOSE

fclosea.c

Closing all open BFILEs

Closing All Open BFILEs with FILECLOSEALL

fcopyloc.c

Copying a LOB locator for a BFILE

About Assigning a BFILE Locator

fdisplay.c

Displaying BFILE data

About Displaying BFILE Data

fexists.c

Checking if a BFILE exists

Determining Whether a BFILE Exists

ffilopen.c

Opening a BFILE with FILEOPEN

About Opening a BFILE with FILEOPEN

ffisopen.c

Checking if the BFILE is OPEN with FILEISOPEN

About Determining Whether a BFILE Is Open with FILEISOPEN

fgetdir.c

Getting the directory object name and filename of a BFILE

Getting Directory Object Name and File Name of a BFILE

finsert.c

Inserting row containing a BFILE by initializing a BFILE locator

About Inserting a Row Containing a BFILE

fisopen.c

Checking if the BFILE is open with ISOPEN

About Determining Whether a BFILE Is Open Using ISOPEN

flength.c

Getting the length of a BFILE

Getting the Length of a BFILE

floadlob.c

Loading a LOB with BFILE data

About Loading a LOB with BFILE Data

fopen.c

Opening a BFILE with OPEN

About Opening a BFILE with OPEN

fread.c

Reading data from a BFILE

About Reading Data from a BFILE

fupdate.c

Updating a BFILE by initializing a BFILE locator

About Updating a BFILE by Initializing a BFILE Locator

lappend.c

Appending one LOB to another

About Appending One LOB to Another

lcopy.c

Copying all or part of a LOB to another LOB

Copying All or Part of One LOB to Another LOB

lcopyloc.c

Copying a LOB locator

Copying All or Part of One LOB to Another LOB

ldisbuf.c

Disabling LOB buffering (persistent LOBs)

About Disabling LOB Buffering

ldisplay.c

Displaying LOB data

About Displaying LOB Data

lequal.c

Seeing if one LOB locator is equal to another

Equality: Checking If One LOB Locator Is Equal to Another

lerase.c

Erasing part of a LOB

About Erasing Part of a LOB

lgetchar.c

Getting character set id

About Determining Character Set ID

lgetchfm.c

Getting character set form of the foreign language ad text, ad_fltextn

About Determining Character Set Form

linit.c

Seeing if a LOB locator is initialized

About Determining Whether LOB Locator Is Initialized

linsert.c

Inserting a row by initializing LOB locator bind variable

Inserting a Row by Initializing a LOB Locator Bind Variable

lisopen.c

Seeing if LOB is open

Determining Whether a LOB is Open

listemp.c

Seeing if LOB is temporary

Determining Whether a LOB instance Is Temporary

llength.c

Getting the length of a LOB

Length: Determining the Length of a LOB

lloaddat.c

Loading a LOB with BFILE data

Loading a LOB with Data from a BFILE

lread.c

Reading data from LOB

About Reading Data from a LOB

lreadarr.c

Reading data from an array of LOB locators

About LOB Array Read

ltrim.c

Trimming LOB data

About Trimming LOB Data

lwrite.c

Writing data to a LOB

About Writing Data to a LOB

lwritearr.c

Writing data into an array of LOB locators

LOB Array Write

lwriteap.c

Writing to the end of LOB (write append)

About Appending to a LOB

A.3 Java LOB Demonstration Files

The following table lists Java demonstration files. These files are installed in $ORACLE_HOME/rdbms/demo/lobs/java/.

Table A-3 Java Demonstration Examples

File Name Description Usage Information

Readme.txt

-

See Oracle Database JDBC Developer's Guide for information on setting up your system to be able to compile and run JDBC programs with the Oracle Driver

LobDemoConnectionFactory.java

-

As written LobDemoConnectionFactory uses the JDBC OCI driver with a local connection. You should edit the URL "jdbc:oracle:oci8:@" to match your setup. Again see Oracle Database JDBC Developer's Guide.

fclose_c.java

Closing a BFILE with CLOSE

Closing a BFILE with CLOSE

fclose_f.java

Closing a BFILE with FILECLOSE

Closing a BFILE with FILECLOSE

fclosea.java

Closing all open BFILEs

Closing All Open BFILEs with FILECLOSEALL

fcompare.java

Comparing all or parts of two BFILEs

Comparing All or Parts of Two BFILES

fexists.java

Checking if a BFILE exists

Determining Whether a BFILE Exists

ffilopen.java

Opening a BFILE with FILEOPEN

About Opening a BFILE with FILEOPEN

ffisopen.java

Checking if the BFILE is OPEN with FILEISOPEN

About Determining Whether a BFILE Is Open with FILEISOPEN

fgetdir.java

Getting the directory object name and filename of a BFILE

Getting Directory Object Name and File Name of a BFILE

finsert.java

Inserting row containing a BFILE by initializing a BFILE locator

About Inserting a Row Containing a BFILE

fisopen.java

Checking if the BFILE is open with ISOPEN

About Determining Whether a BFILE Is Open Using ISOPEN

flength.java

Getting the length of a BFILE

Getting the Length of a BFILE

fopen.java

Opening a BFILE with OPEN

About Opening a BFILE with OPEN

fpattern.java

Checking if a pattern exists in a BFILE using instr

Checking If a Pattern Exists in a BFILE Using INSTR

fread.java

Reading data from a BFILE

About Reading Data from a BFILE

fupdate.java

Updating a BFILE by initializing a BFILE locator

About Updating a BFILE by Initializing a BFILE Locator

lappend.java

Appending one LOB to another

About Appending One LOB to Another

lcompare.java

Comparing all or part of LOB

Comparing All or Part of Two LOBs

lcopy.java

Copying all or part of a LOB to another LOB

Copying All or Part of One LOB to Another LOB

lerase.java

Erasing part of a LOB

About Erasing Part of a LOB

linsert.java

Inserting a row by initializing LOB locator bind variable

Inserting a Row by Initializing a LOB Locator Bind Variable

linstr.java

Seeing if pattern exists in LOB (instr)

Patterns: Checking for Patterns in a LOB Using INSTR

lisopen.java

Seeing if LOB is open

Determining Whether a LOB is Open

listempb.java

Seeing if LOB is temporary

Determining Whether a LOB instance Is Temporary

listempc.java

Seeing if LOB is temporary

Determining Whether a LOB instance Is Temporary

llength.java

Getting the length of a LOB

Length: Determining the Length of a LOB

lloaddat.java

Loading a LOB with BFILE data

Loading a LOB with Data from a BFILE

lread.java

Reading data from LOB

About Reading Data from a LOB

lsubstr.java

Reading portion of LOB (substr)

Reading a Portion of a LOB (SUBSTR)

ltrim.java

Trimming LOB data

About Trimming LOB Data

lwrite.java

Writing data to a LOB

About Writing Data to a LOB

lwriteap.java

Writing to the end of LOB (write append)

About Appending to a LOB