Oracle8i Application Developer's Guide - Large Objects (LOBs) Release 2 (8.1.6) Part Number A76940-01 |
|
LOB Programmatic Environments, 8 of 9
You can make changes to an entire internal LOB, or to pieces of the beginning, middle or end of it via the Oracle Objects for OLE (OO4O) API, by using one of the following objects interfaces:
:
To provide methods for performing operations on BLOB datatypes in the database
:
To provide methods for performing operations on CLOB datatypes in the database
:
To provide methods for performing operations on BFILE data stored in operating system files.
OO4O syntax reference is viewed from the OO4O online help.
Oracle Objects for OLE (OO4O), a Windows-based product included with Oracle8i Client for Windows NT, has no manuals, only online help.
Its online help is available through the Application Development submenu of the Oracle8i installation. To view specific methods and properties from the Help Topics menu, select the Contents tab > OO4O Automation Server > Methods or Properties.
For further information about OO4O, refer to the following web site:
Select Products > Internet Tools > Programmer. Scroll down to "Oracle Objects for OLE". At the bottom of the page is a list of useful articles for using the interfaces.
http://www.oracle.com/products
Search for articles on OO4O or Oracle Objects for OLE.
These interfaces encapsulate LOB locators, so you do not deal directly with locators, but instead, can use methods and properties provided to perform operations and get state information.
When OraBlob
and OraClob
objects are retrieved as a part of a dynaset, these objects represent LOB locators of the dynaset current row. If the dynaset current row changes due to a move operation, the OraBlob
and OraClob
objects represent the LOB locator for the new current row.
To retain the LOB locator of the OraBlob
and OraClob
object independent of the dynaset move operation, use the Clone
method. This method returns the OraBlob
and OraClob
object. You can also use these objects as PL/SQL bind parameters.
The following example shows usage of OraBlob and OraBfile. Functions and examples are explained in greater detail in Chapters 9, 10, and 11.
Dim OraDyn as OraDynaset, OraSound1 as OraBLOB, OraSoundClone as OraBlob, OraMyBfile as OraBFile OraConnection.BeginTrans set OraDyn = OraDb.CreateDynaset("select * from Multimedia_tab order by clip_ id", ORADYN_DEFAULT) set OraSound1 = OraDyn.Fields("Sound").value set OraSoundClone = OraSound1 OraParameters.Add "id", 1,ORAPARAM_INPUT OraParameters.Add "mybfile", Empty,ORAPARAM_OUTPUT OraParameters("mybfile").ServerType = ORATYPE_BFILE OraDatabase.ExecuteSQL ("begin GetBFile(:id, :mybfile ") end") Set OraMyBFile = OraParameters("mybfile").value'Go to Next row
OraDyn.MoveNext OraDyn.Edit'Lets update OraSound1 data with that from the BFILE
OraSound1.CopyFromBFile OraMyBFile OraDyn.Update OraDyn.MoveNext'Go to Next row
OraDyn.Edit'Lets update OraSound1 by appending with LOB data from 1st row represenetd by 'OraSoundClone
OraSound1.Append OraSoundClone OraDyn.Update OraConnection.CommitTrans
In the above example:
OraSound1
-- represents the locator for the current row in the dynaset OraSoundClone
-- represents the locator for the 1st row.
A change in the current row (say a OraDyn.MoveNext
) means the following:
OraSound1
-- will represent the locator for the 2nd row
OraSoundClone --
will represent the locator in the 1st row. OraSoundClone
only refers the locator for the 1st row irrespective of any OraDyn
row navigation).
OraMyBFile
-- refers to the locator obtained from an PL/SQL "OUT" parameter as a result of executing a PL/SQL procedure, either by doing an OraDatabase
.ExecuteSQL
.
Oracle Objects for OLE (OO4O) includes methods and properties that you can use to access data stored in BLOB
s, CLOB
s, NCLOB
s, and BFILE
s. These methods and properties are listed in the tables below, and are discussed in greater detail in the following chapters:
You will also be able to access these scripts from your Oracle8i software CD /rdbms/demo directory in a future release.
The following OO4O methods and properties operate on BLOBs, CLOBs, NCLOBs, and BFILEs:
Method | Description |
---|---|
|
|
|
|
Methods | Description |
---|---|
|
Closes an open |
|
Closes all open |
|
Opens a |
OraBFile.IsOpen |
Determines if a BFILE is open |
|
![]() Copyright © 1996-2000, Oracle Corporation. All Rights Reserved. |
|