CL_ABAP_DB_X_LOCATOR - Binary LOB Locator

ABAP Short Reference   General Data in Customer Master  
This documentation is copyright by SAP AG.

Functionality

The class CL_ABAP_DB_X_LOCATOR implements access by using a locator to a binary LOB in a database table.A locator represents a pointer to the LOB data. You can use a locator, for example, to search for astring in the LOB data. An instance of the class CL_ABAP_DB_X_LOCATOR can only be created by using aSELECT statement. When doing this, the data of the LOB is not passed to the application server. An instanceof this class can also be used as input for a change operation on a binary 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_X_LOCATOR implements the following methods:

CLOSE

IS_CLOSED

GET_LENGTH

GET_BYTES

FIND

Example

The database table dbtab has an integer key field k1 and a binary LOB column blob1.

data: x_loc type ref to cl_abap_db_x_locator,

      len type abap_msize, xstr type xstring.

select single blob1 from dbtab into x_loc where k1 = 1.

if sy-subrc = 0.

  len = x_loc->get_length( ).

  if len > 0.

    len = len div 2.

    xstr = x_loc->get_bytes( offset = 0 length = len ).

    write: /'First half of xstring = ', xstr.

  else.

    write: /'Initial xstring found'.

  endif.

  x_loc->close( ).

else.

    write: /'No data found'.

endif.



Vendor Master (General Section)   BAL Application Log Documentation  
This documentation is copyright by SAP AG.


Length: 3322 Date: 20120526 Time: 080333     triton ( 81 ms )