CL_ABAP_DB_C_LOCATOR - Locator for a Character-like LOB

General Material Data   General Data in Customer Master  
This documentation is copyright by SAP AG.

Functionality

The class CL_ABAP_DB_C_LOCATOR implements access by using a locator to a character-like LOB in a databasetable. A locator represents a pointer to the LOB data. You can use a locator, for example, to searchfor a string in the LOB data. An instance of the class CL_ABAP_DB_C_LOCATOR can only be created by usinga SELECT statement. When doing this, the data of the LOB is not passed to the application server. Aninstance of this class can also be used as input for a change operation on a character-like LOB column.In this way, the LOB data pointed to by the locator is passed to the column specified in the change operation, without the need to materialize the LOB data on the application server.

Further information

The class CL_ABAP_DB_C_LOCATOR implements the following methods:

CLOSE

IS_CLOSED

GET_LENGTH

GET_SUBSTRING

FIND

Example

The database table dbtab has an integer key field k1 and a character-like LOB column clob1.

data: c_loc type ref to cl_abap_db_c_locator,

      len type abap_msize, str type string.

select single clob1 from dbtab into c_loc where k1 = 1.

if sy-subrc = 0.

  len = c_loc->get_length( ).

  if len > 0.

    len = len div 2.

    str = c_loc->get_substring( offset = 0 length = len ).

    write: /'First half of string = ', str.

  else.

    write: /'Initial string found'.

  endif.

  c_loc->close( ).

else.

    write: /'No data found'.

endif.

Notes



CL_GUI_FRONTEND_SERVICES - Frontend Services   BAL Application Log Documentation  
This documentation is copyright by SAP AG.


Length: 3359 Date: 20120526 Time: 080014     triton ( 117 ms )