How can I access more than 1 element from a field in Progress 4GL

Discussão em 'StackOverflow' iniciado por fdantas, Dezembro 9, 2020.

  1. fdantas

    fdantas Administrator Moderador

    all. I want to get more than one element from a field. If, for instance, the SQL code is as folow:


    SELECT cod_emit, nom_abrev FROM emit WHERE cod_emit IN ('101','102','500');
    ​

    I'm trying to transform it into Progress using temp-tables so code would be as follows

    DEF TEMP-TABLE tt-emit NO-UNDO
    FIELD cod-emit LIKE emit.cod-emit
    FIELD nom-abrev LIKE emit.nom-abrev.
    FOR EACH emit
    WHERE emit.cod-emit = 101
    OR emit.cod-emit = 102
    OR emit.cod-emit = 500 NO-LOCK:
    CREATE tt-emit.
    ASSIGN tt-emit.cod-emit = emit.cod-emit
    tt-emit.nom-abrev = emit.nom-abrev.
    END.


    Later, I would get the temp-table through a JSON and use it on our .php. However, the cod-emit we need to use will be inserted by the user in a .php. I don't know if we can use a comma in this case (but for what I tried, we can't) or if there's any other solution to this conundrum. Thanks for your time.

    Continue reading...

Compartilhe esta Página