Consultor Eletrônico



Kbase P10394: Example of how to implement the IN option (in the where clause) of SQL in 4GL against a fill-in cont
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   8/22/2003
Status: Unverified

GOAL:

Example of how to implement the IN option (in the where clause) of SQL in 4GL against a fill-in containing a list of values

FIX:

DEF VAR lista AS CHAR.
DEF VAR i AS INTEGER.

DO WITH FRAME {&FRAME-NAME}:
FOR EACH t-clientes :
DELETE t-clientes.
END.

/* Fill in a temp-table with the values of the string (in this case a fill-in) containing the list of values */
lista = txt-valores:SCREEN-VALUE.
DO i = 1 TO NUM-ENTRIES(lista):
FIND FIRST t-clientes WHERE t-clientes.num-cliente =
INTEGER(ENTRY(i,lista)) NO-LOCK NO-ERROR.
IF NOT AVAILABLE t-clientes THEN
DO:
CREATE t-clientes.
t-clientes.num-cliente = INTEGER(ENTRY(i, lista)).
END.
END.
/* JOIN */
FOR EACH t-clientes, EACH cabecera_albaran WHERE
cabecera_albaran.cod-cliente = t-clientes.num-cliente
NO-LOCK:

MESSAGE cabecera_albaran.fecha-albaran ' '
cabecera_albaran.num-albaran
VIEW-AS ALERT-BOX INFO BUTTONS OK.

END.

END.