1. f
2. dbtab~field
3. tabalias~field
Used in the
SELECT, OPEN CURSOR,
UPDATE and DELETE
commands to uniquely identify columns (fields) of database tables
and views specified in FROM clauses.
f
Identifies the field f of a database table or view specified
in the FROM clause.
The name f may only occur once in all database tables
or views, that is, it must be unique. You use this variant particularly when there
is only one table specified in the FROM clause. If the uniqueness of the field cannot be guaranteed, you must use variant 2 or 3.
Output a list of all customers whose names begin with 'A':
DATA: WA_SCUSTOM TYPE SCUSTOM.
SELECT * FROM SCUSTOM INTO WA_SCUSTOM WHERE NAME LIKE 'A%'.
WRITE: / WA_SCUSTOM-ID, WA_SCUSTOM-NAME.
ENDSELECT.
dbtab~field
Identifies field
f in the database table or view dbtab specified
in the FROM clause.
The combination dbtab~field must be unique.
You can use this variant if table dbtab only appears once
in the FROM clause. If this uniqueness cannot be assured, you must use variant 3.
Output a list of all customers whose names begin with 'A':
DATA: WA_SCUSTOM TYPE SCUSTOM.
SELECT * FROM SCUSTOM INTO WA_SCUSTOM
WHERE SCUSTOM~NAME LIKE 'A%'.
WRITE: / WA_SCUSTOM-ID, WA_SCUSTOM-NAME.
ENDSELECT.
Variant 3,,tabalias~field
Identifies field f in the table or view with the alias
name tabalias specified in the FROM clause.
Output a list of all customers whose name begins with 'A':
DATA: WA_SCUSTOM TYPE SCUSTOM.
SELECT * FROM SCUSTOM AS T INTO WA_SCUSTOM WHERE T~NAME LIKE 'A%'.
WRITE: / WA_SCUSTOM-ID, WA_SCUSTOM-NAME.
ENDSELECT.
Open SQL