A Comparing the LOB Interfaces
The tables in this section compare the eight LOB programmatic interfaces by listing their functions and methods used to operate on LOBs. The tables are split in two only to accommodate all eight interfaces.
APIs for BLOBs and CLOBs
Table A-1 APIs for BLOBs and CLOBs (PL/SQL, JDBC, OCI, OCCI)
PL/SQL: DBMS_LOB (dbmslob.sql) | JDBC (Java) interfaces java.sql.Clob and java.sql.Blob | OCI (C/ocip.h) | OCCI (C++/occiData.h) classes: Clob and Blob |
---|---|---|---|
NA | NA | OCILobLocatorIsInit() |
isInitialized() |
ISSECUREFILE |
isSecureFile() |
NA | NA |
OPEN |
open() |
OCILobOpen() |
Open() |
ISOPEN |
isOpen() |
OCILobIsOpen() |
isOpen() |
CLOSE |
close() |
OCILobClose() |
Close() |
CREATETEMPORARY |
createTemporary |
OCILobCreateTemporary() |
NA |
FREETEMPORARY |
freeTemporary |
OCILobFreeTemporary() |
NA |
ISTEMPORARY |
isTemporary |
OCILobIsTemporary() |
NA |
GETLENGTH |
length() |
OCIGetLobLength2() |
length() |
GET_STORAGE_LIMIT |
NA | OCILobGetStorageLimit() |
NA |
GETCHUNKSIZE |
getChunkSize() |
OCILobGetChunkSize() |
getChunkSize() |
READ |
Blob: getBytes() getBinaryStream() |
OciLobRead2()
OCILobArrayRead() |
read() |
Clob: getChars() getCharacterStream()
getAsciiStream() |
|||
SUBSTR |
getSubString |
NA | NA |
INSTR |
position |
NA | NA |
NA | NA | OCILobCharSetId() |
getCharSetId() (Clob only) |
NA | NA | OCILobCharSetForm() |
getCharSetForm (Clob only) |
WRITE |
Blob: setBytes() setBinaryStream() |
OCILobWrite2()
OCILobArrayWrite() |
write |
Clob: setString() setCharacterStream() |
|||
WRITEAPPEND |
use length() and then putString() or putBytes() |
OCILobWriteAppend2() |
NA |
ERASE |
NA | OCILobErase2() |
NA |
TRIM |
truncate() |
OCILobTrim2() |
trim |
NA | equal |
OCILobIsEqual() |
Use operators == / != |
COMPARE |
Use DBMS_LOB |
NA | NA |
APPEND |
Use length() and then
putString() or
putBytes() |
OCILobWriteAppend2() |
NA |
COPY |
Use read and write |
OCILobCopy2() |
copy() |
Use operator := |
Use operator = |
OCILobLocatorAssign() |
use operator = |
CONVERTTOBLOB |
NA | NA | NA |
CONVERTTOCLOB |
NA | NA | NA |
NA | NA | NA | closeStream() |
GETOPTIONS |
NA | OCILobGetOptions() |
getOptions() |
SETOPTIONS |
NA | OCILobSetOptions() |
setOptions() |
GETCONTENTTYPE |
NA | OciLobGetContentType() |
getContentType() |
SETCONTENTTYPE |
NA | OciLobSetContentType() |
setContentType() |
FRAGMENT_DELETE FRAGMENT_INSERT FRAGMENT_MOVE
FRAGMENT_REPLACE |
NA | NA | NA |
Table A-2 APIs for BLOB and CLOB (PL/SQL, .NET, Pro*C/C++, Pro COBOL)
PL/SQL: DBMS_LOB (dbmslob.sql) | ODP.NET Classes: OracleClob and OracleBlob | Pro*C/C++ and Pro*COBOL |
---|---|---|
OPEN |
BeginChunkWrite |
OPEN |
ISOPEN |
IsInChunkWriteMode |
DESCRIBE [ISOPEN] |
CLOSE |
EndChunkWrite |
CLOSE |
CREATETEMPORARY |
Add() |
CREATE TEMPORARY |
FREETEMPORARY |
Dispose() and Close() |
FREE TEMPORARY |
ISTEMPORARY |
IsTemporary() |
DESCRIBE [ISTEMPORARY] |
GETLENGTH |
Length() |
DESCRIBE [LENGTH] |
GETCHUNKSIZE |
OptimumChunkSize() |
DESCRIBE [CHUNKSIZE] |
READ |
Value Read |
READ |
INSTR |
Search |
NA |
WRITE |
Write |
WRITE |
WRITEAPPEND |
Append |
WRITE APPEND |
ERASE |
Erase |
ERASE |
TRIM |
SetLength |
TRIM |
NA | IsEqual |
NA |
COMPARE |
Compare |
NA |
APPEND |
Append |
APPEND |
COPY |
CopyTo |
COPY |
Use operator := |
Clone |
ASSIGN |
APIs for BFILEs
Table A-3 APIs for BFILEs (PL/SQL, JDBC, OCI, OCCI)
PL/SQL: DBMS_LOB (dbmslob.sql) | JDBC (Java) interface oracle.jdbc.OracleBfile | OCI (C/ociap.h) | OCCI (C++/occiData.h) class: Bfile |
---|---|---|---|
FILEEXISTS |
fileExists |
OciLobFileExist() |
fileExists() |
FILEGETNAME |
getDirAlias, getName |
OCILobFileGetName() |
getDirAlias() getFileName() |
SQL BFILENAME operator |
SQL BFILENAME operator |
OCILobFileSetName() |
setName() |
OPEN |
openFile |
OCILobOpen() |
open() |
ISOPEN |
isFileOpen() |
OCILobIsOpen() |
isOpen() |
CLOSE |
closeFile |
OCILobClose() |
close() |
FILECLOSEALL |
Use DBMS_LOB |
OCILobFileCloseAll() |
NA |
GETLENGTH |
length |
OCILobGetLength2() |
length() |
READ |
getBytes() getBinaryStream() |
OCILobRead() OCILobArrayRead() |
read |
SUBSTR |
getBytes |
NA | NA |
INSTR |
position |
NA | NA |
Use operator := |
Use operator = |
OCILobLocatorAssign() |
Use operator = |
LOADCLOBFROMFILE LOADBLOBFROMFILE |
NA | OCILobLoadFromFile2() |
Blob.copy() or Clob.copy()
|
COMPARE |
NA | NA | NA |
NA | equal |
OCILobIsEqual() |
Use operators ==/!= |
Table A-4 APIs for BFILEs (PL/SQL, ODP.NET, Pro*C/C++ and Pro*COBOL)
PL/SQL: DBMS_LOB (dbmslob.sql) | ODP.NET Class: OracleBfile | Pro*C/C++ and Pro*COBOL |
---|---|---|
FILEEXISTS |
FileExists |
DESCRIBE [FILEEXISTS] |
FILEGETNAME |
DirectoryName, Filename |
DESCRIBE [DIRECTORY, FILENAME] |
SQL BFILENAME operator |
DirectoryName, Filename |
FILE SET |
OPEN |
OpenFile |
OPEN |
ISOPEN |
IsOpen() |
DESCRIBE [ISOPEN] |
CLOSE |
CloseFile |
CLOSE |
FILECLOSEALL |
NA | FILE CLOSE ALL |
GETLENGTH |
Length |
DESCRIBE [LENGTH] |
READ |
Value,Read |
READ |
SUBSTR |
NA | NA |
INSTR |
Search |
NA |
Use operator := |
NA | NA |
LOADCLOBFROMFILE LOADBLOBFROMFILE |
NA | NA |
COMPARE |
Compare |
NA |
NA | IsEqual |
NA |