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

  2. Anuncie Aqui ! Entre em contato fdantas@4each.com.br

Check if record already exists when doing a buffer-copy

Discussão em 'StackOverflow' iniciado por fdantas, Maio 3, 2018.

  1. fdantas

    fdantas Administrator Moderador

    I have a piece of code which does a Buffer-Copy method, but is there any way to check before doing the buffer copy of the record already exists? I do not want to check 'unique keys' in my data dictionary.

    This is the code I have at this moment:

    CREATE QUERY hQuery.
    hQuery:SET-BUFFERS(hBuffer).
    hQuery:QUERY-PREPARE("FOR EACH " + hBuffer:NAME + " NO-LOCK ").
    hQuery:QUERY-OPEN().


    hQuery:GET-FIRST().
    DO WHILE NOT hQuery:QUERY-OFF-END:
    DO TRANSACTION ON ERROR UNDO:

    hDBBuffer:BUFFER-CREATE().
    hDBBuffer:BUFFER-COPY(hBuffer) NO-ERROR.

    Continue reading...

Compartilhe esta Página