Code: Alles auswählen.
* FTAB sei wie folgt gefüllt:
*
* CARRID CONNID
* --------------
* LH 2415
* SQ 0026
* LH 0400
SELECT * FROM SFLIGHT INTO WA_SFLIGHT
FOR ALL ENTRIES IN FTAB
WHERE CARRID = FTAB-CARRID AND
CONNID = FTAB-CONNID AND
FLDATE = '19950228'.
RATIO = WA_SFLIGHT-SEATSOCC / WA_SFLIGHT-SEATSMAX.
WRITE: / WA_SFLIGHT-CARRID, WA_SFLIGHT-CONNID, RATIO.
ENDSELECT.
* Der Befehl wirkt dann wie:
SELECT DISTINCT * FROM SFLIGHT INTO WA_SFLIGHT
WHERE ( CARRID = 'LH' AND
CONNID = '2415' AND
FLDATE = '19950228' ) OR
( CARRID = 'SQ' AND
CONNID = '0026' AND
FLDATE = '19950228' ) OR
( CARRID = 'LH' AND
CONNID = '0400' AND
FLDATE = '19950228' ).
RATIO = WA_SFLIGHT-SEATSOCC / WA_SFLIGHT-SEATSMAX.
WRITE: / WA_SFLIGHT-CARRID, WA_SFLIGHT-CONNID, RATIO.
ENDSELECT.
Code: Alles auswählen.
SELECT * FROM SFLIGHT INTO WA_SFLIGHT
FOR ALL ENTRIES IN FTAB
WHERE CARRID = FTAB-CARRID AND
CONNID = FTAB-CONNID AND
FLDATE = '19950228'.
RATIO = WA_SFLIGHT-SEATSOCC / WA_SFLIGHT-SEATSMAX.
WRITE: / WA_SFLIGHT-CARRID, WA_SFLIGHT-CONNID, RATIO.
ENDSELECT.
Code: Alles auswählen.
SELECT * FROM SFLIGHT INTO WA_SFLIGHT
WHERE CARRID = FTAB-CARRID AND
CONNID = FTAB-CONNID AND
FLDATE = '19950228'.
RATIO = WA_SFLIGHT-SEATSOCC / WA_SFLIGHT-SEATSMAX.
WRITE: / WA_SFLIGHT-CARRID, WA_SFLIGHT-CONNID, RATIO.
ENDSELECT.
Der Unterschied ist ganz einfach der das ein FOR ALL ENTRIES beim Daten lesen aus der DB im SELECT Statement benutzt wird.Was ist der Unterschied zwischen
FOR ALL ENTRIES und DELETE ADJACENT DUPLICATES ?