SAP INDX TYPE TABLE AND SQL SAP Info












ARTICLE ( Version: 0027)

SQL Access to INDX-Type Database Tables
INDX-type database tables are
relational databases defined in the ABAP Dictionary. For this reason, it is in principle possible to access INDX-type database tables using (Open) SQL statements.
To use SQL statements on INDX-type database tables
effectively, you must take into account the special structure of these database tables.
For example, it is not sensible to access the fields CLUSTR and
CLUSTID for read or write operations. These fields contain the data cluster in an internal format and can only be handled correctly using the EXPORT TO DATABASE and IMPORT FROM DATABASE statements.
SQL statements should only be used if the corresponding
combination of specific data cluster statements would be too inefficient. The SQL statement INSERT should never be used on an INDX-type database table.
Open SQL statements can, in certain circumstances, be used for
administrative operations on INDX-type databases, for which the data cluster specific statements are not suitable.

Examples
An INDX-type database can be systematically searched for a
particular data cluster using SELECT; at the same time, information in the freely definable columns can be evaluated. The following example deletes all the data clusters from an area of the database table INDX, that have been created by a specific user. Each time, all rows of the data cluster are to be deleted. DATA indx_wa TYPE indx.

SELECT *
FROM indx
INTO indx_wa
WHERE relid = ... AND
srtf2 = 0 AND
usera = sy-uname.

DELETE FROM DATABASE indx(...) ID indx_wa-srtfd.
The following example shows, how the identifier and area of a data
cluster in the database table INDX can be altered using UPDATE. Solving this problem using the special cluster statements would be considerably more time-consuming. UPDATE indx
SET relid = new_relid
srtfd = new_srtfd
WHERE relid = old_relid AND
srtfd = old_srtfd.

ARTICLE ( Version: 0028)

SQL Access to INDX-Type Database Tables
INDX-type database tables are
relational databases defined in the ABAP Dictionary. For this reason, it is in principle possible to access INDX-type database tables using (Open) SQL statements.
To use SQL statements on INDX-type database tables
effectively, you must take into account the special structure of these database tables.
For example, it is not sensible to access the fields CLUSTR and
CLUSTID for read or write operations. These fields contain the data cluster in an internal format and can only be handled correctly using the EXPORT TO DATABASE and IMPORT FROM DATABASE statements.
SQL statements should only be used if the corresponding
combination of specific data cluster statements would be too inefficient. The SQL statement INSERT should never be used on an INDX-type database table.
Open SQL statements can, in certain circumstances, be used for
administrative operations on INDX-type databases, for which the data cluster specific statements are not suitable.

Examples
An INDX-type database can be systematically searched for a
particular data cluster using SELECT; at the same time, information in the freely definable columns can be evaluated. The following example deletes all the data clusters from an area of the database table INDX that have been created by a specific user. Each time, all rows of the data cluster are to be deleted. DATA indx_wa TYPE indx.

SELECT *
FROM indx
INTO indx_wa
WHERE relid = ... AND
srtf2 = 0 AND
usera = sy-uname.

DELETE FROM DATABASE indx(...) ID indx_wa-srtfd.
The following example shows, how the identifier and area of a data
cluster in the database table INDX can be altered using UPDATE. Solving this problem using the special cluster statements would be considerably more time-consuming. UPDATE indx
SET relid = new_relid
srtfd = new_srtfd
WHERE relid = old_relid AND
srtfd = old_srtfd.

ARTICLE ( Version: 0030)

SQL Access to INDX-Like Database Tables
INDX-like database tables are
relational databases defined in ABAP Dictionary. For this reason, it is in principle possible to access INDX-like database tables using ( Open) SQL statements.
To use SQL statements on INDX-like database tables
effectively, you must respect the special structure of these database tables.
For example, it is not a good idea to access the fields CLUSTR
and CLUSTID for read or write operations. These fields contain the data cluster in an internal format and can only be handled correctly using the EXPORT TO DATABASE and IMPORT FROM DATABASE statements.
SQL statements should only be used if the corresponding
combination of specific data cluster statements would be too inefficient. The SQL statement INSERT should never be used on an INDX-like database table.
Open SQL statements can, in certain circumstances, be used for
administrative operations on INDX-like database tables, for which the data cluster specific statements are not suitable.

Examples
An INDX-like database can be searched systematically for a
particular data cluster using SELECT; at the same time, information in the freely definable columns can be evaluated. The following example deletes all the data clusters from an area of the database table INDX, that have been created by a specific user. Each time, all rows of the data cluster are to be deleted. DATA indx_wa TYPE indx.

SELECT *
FROM indx
INTO indx_wa
WHERE relid = ... AND
srtf2 = 0 AND
usera = sy-uname.

DELETE FROM DATABASE indx(...) ID indx_wa-srtfd.
The following example shows, how the identifier and area of a data
cluster in the database table INDX can be altered using UPDATE. Solving this problem using the special cluster statements would be considerably more time-consuming. UPDATE indx
SET relid = new_relid
srtfd = new_srtfd
WHERE relid = old_relid AND
srtfd = old_srtfd.

ARTICLE ( Version: 0031)

SQL Access to INDX-Like Database Tables
INDX-like database tables are
relational databases defined in ABAP Dictionary. This means that, in principle, (Open) SQL statements can also be used to access INDX like database tables.
To use SQL statements on INDX-like database tables
effectively, you must respect the special structure of these database tables.
For example, it is not a good idea to access the fields CLUSTR
and CLUSTID for read or write operations. These fields contain the data cluster in an internal format and can only be handled correctly using the EXPORT TO DATABASE and IMPORT FROM DATABASE statements.
SQL statements should only be used if the corresponding
combination of specific data cluster statements would be too inefficient. The SQL statement INSERT should never be used on an INDX-like database table.
Open SQL statements can, in certain circumstances, be used for
administrative operations on INDX-like database tables, for which the data cluster specific statements are not suitable.

Examples
An INDX-like database can be searched systematically for a
particular data cluster using SELECT; at the same time, information in the freely definable columns can be evaluated. The following example deletes all the data clusters from an area of the database table DEMO_INDX_TABLE, that have been created by a specific user. Each time, all rows of the data cluster are to be deleted. DATA indx_wa TYPE demo_indx_table.

SELECT SINGLE *
FROM demo_indx_table
INTO indx_wa
WHERE relid = ... AND
srtf2 = 0 AND
userid = sy-uname.

DELETE FROM DATABASE demo_indx_table(...) ID indx_wa-id.
The following example shows, how the identifier and area of a data
cluster in the database table DEMO_INDX_TABLE can be altered using UPDATE. Solving this problem using the special cluster statements would be considerably more time-consuming. UPDATE demo_indx_table
SET relid = new_relid
id = new_id
WHERE relid = old_relid AND
id = old_id.
Message text extract from SAP system. Copyright SAP SE.


Search for further information about these or an SAP related objects



Comments on this SAP object

What made you want to lookup this SAP object? Please tell us what you were looking for and anything you would like to be included on this page!