Edit `TABLE-HANDLER` to point to another temp-table

Discussão em 'StackOverflow' iniciado por fdantas, Dezembro 27, 2016.

  1. fdantas

    fdantas Administrator Moderador

    I'm trying to overwrite the parameter handler, so it'd point to another temp-table with different schema.

    myProcedure.p

    DEFINE TEMP-TABLE TT_RealTable NO-UNDO
    BEFORE-TABLE TT_RealTableBefore
    FIELD name AS CHAR
    .

    DEF INPUT-OUTPUT PARAM TABLE-HANDLE TH_NewTable.

    CREATE TT_RealTable.
    ASSIGN TT_RealTable.name = "Ben".

    CREATE TT_RealTable.
    ASSIGN TT_RealTable.name = "Harry".


    The TH_NewTable points to a random parameter TEMP-TABLE with different schema and contents. I want to overwrite this parameter TABLE-HANDLER with the TT_RealTable. If I try to set:

    TH_NewTable = TEMP-TABLE TT_RealTable:HANDLE.


    The program will crash at runtime saying that TT_RealTable's schema/meta data doesn't match the handler's one.

    How I can overwrite the handler to point to my TT_RealTable:HANDLE, and return it as output?

    Continue reading...

Compartilhe esta Página