ARTICLE
Open SQL - Streaming and Locators
In Open SQL you can use data streams
and locators to access
LOB s in database tables. The corresponding
objects are grouped together under the term
LOB handle s . Whilst a locator is always an LOB
handle , in principal there can also be data streams for other
resources (refer to Streaming ).
For normal access to LOB s, ABAP data objects of the types
string and xstring are used, into which the entire LOB
is transferred for read access and from which the entire LOB is
taken for write access. Data streams and locators , however, work
as follows:
For read access, read streams can be
linked to LOB s using the assignment of corresponding reference
variables. The same applies for write access and
write streams . LOB data can be
partially processed using the methods of the streams. This is
advantageous, since the LOB s do not have to be completely
realized in the ABAP program.
For read- and write access, locators can be linked to LOB s
by assigning corresponding reference variables. Using the methods of the
locators , you can access the sub-sequences of LOB s or the
properties of LOB s without requiring a complete realization in
the ABAP program. Furthermore, locators enable the copying of
LOB s within the database without having to transport the data
between the database and the application server.
The use of data streams and locators for LOB s in database
tables can lead to improved performance with regards to the program
runtime, by omitting unnecessary data transports. There are, however,
also some disadvantages:
The use of locators leads to higher resource consumption in the
database system. Locators are not yet supported by all databases.
In this case, they have to be emulated from the database interface on
the application server.
The use of data streams does not lead to increased resource consumption
in the database system, but data streams are somewhat more limited in
their use. In particular, data streams can not be used if internal
tables are being processed in the Open SQL statements.
The following sections introduce the classes for data streams and
locators as well as the interfaces they include for general LOB
handle s.
Streaming
Locators
LOB Interfaces
Note
A maximum of 1000 LOB handle s can be open in a
database LUW .
Documentation extract taken from SAP system, � Copyright SAP AG. All rights reserved