Large Character and Binary Data
Under normal circumstances, text and binary data is formatted and added to an SQL statement for execution by the Oracle Server. The formatting of the data is handled automatically by the DB Access Module for Oracle OCI. However, when large character and binary data is provided to the
RWDBCursor,
RWDBInserter, or
RWDBUpdater classes, the DB Access Module for Oracle OCI uses another method to bind the data to the statement. This method allows larger values to be inserted and updated.
The OCI documentation suggests that there is a limitation on the lengths of large character or binary data. This is also true for allocations of memory within a specific operating system. In either case, the DB Access Module for Oracle OCI returns RWDBStatus::notSupported if the implementation cannot process the given data because the length exceeds the capabilities of OCI.
Oracle also has limitations on using large character and binary data. Only one LONG or LONG RAW column can be specified per table. LONG or LONG RAW columns cannot be used in conditional clauses, such as WHERE clauses. However, selecting more than one LONG or LONG RAW column is possible through joins of tables.
While inserting data, the Oracle datatype
SYS.XMLTYPE is handled through OCILobLocator. For DB Access Module for Oracle OCI to bind data for
SYS.XMLTYPE correctly, the
RWDBInserter must have the proper table schema associated with it. The inserter gets the proper schema by calling
describe(RWDBTable::ColumnList) on the table before the inserter is produced. Here is an example:
// CREATE TABLE foo(c NUMBER(9), xmlcol SYS.XMLTYPE);
RWDBTable foo = myDb.table("foo");
foo.describe(RWDBTable::ColumnList, myConn);
RWDBInserter ins = foo.inserter();
int c;
RWCString xml;
// fill in data ...
ins << c << xml;
ins.execute(myConn);
...