• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Question Locked table

#1
I have a problem that is as follows. I have a table, order-purchase, which is being used by a user ... No code type found, no code of any kind, I was wondering if there is a way for me to identify if there is any table allocated without a bank and if it exists, I return an error for my mother application.

Code:
FOR EACH ordem-proc

    DISP ordem-proc.id.

END.
 
#2
This procedure only returns when I leave a table.

Code:
DEFINE TEMP-TABLE ttProcessos
    FIELD iProcesso   LIKE proc-compra.nr-processo
INDEX Proc iProcesso.


DEFINE DATASET dsProcessos FOR ttProcessos.
DEFINE VARIABLE hdProcessos AS HANDLE     NO-UNDO.                       
hdProcessos = DATASET dsProcessos:HANDLE.

DEFINE INPUT  PARAMETER picComprador  AS CHAR FORMAT "X(12)".
DEFINE INPUT  PARAMETER pilEnviado    LIKE scw_proc_log.enviado.
DEFINE INPUT  PARAMETER pilRespondido LIKE scw_proc_log.respondido.
DEFINE OUTPUT PARAMETER DATASET FOR dsProcessos.

DEFINE VARIABLE processo AS INTEGER INITIAL 0.


FOR EACH scw_proc_log WHERE
    scw_proc_log.cod-comprado = picComprador  AND
    scw_proc_log.enviado      = pilEnviado    AND
    scw_proc_log.respondido   = pilRespondido  NO-LOCK :
    
    IF AVAIL scw_proc_log THEN DO:

             FIND proc-compra WHERE
                         proc-compra.nr-processo = scw_proc_log.nr-processo NO-LOCK NO-ERROR.
                    IF AVAIL proc-compra AND proc-compra.nr-processo <> processo THEN DO:
                
                        CREATE ttProcessos.                                   
                        ASSIGN
                            ttProcessos.iProcesso   = proc-compra.nr-processo.
                
                    END.   
                
                    ASSIGN processo = scw_proc_log.nr-processo.

    END.

    

END.
Table locked

Code:
FIND ordem-compra WHERE ordem-compra.numero-ordem = 80144876 EXCLUSIVE-LOCK.
UPDATE ordem-compra.cod-comprado.