OpenBASE! o Banco de Dados Inteligente  Anterior  Sumário  Fale conosco!  Próximo

Exemplo

banco demo 1  TRANLOG=log.txt

nome: tabela E

  pm_cod (0)  u02

  pm_nome     u40

  pm_campodt  u06

*************************************************************************

*Carrega dados no banco acima

*************************************************************************

prog carga

database  demo 1 a 2

select a

use tabela  

i = 1

for i= 1 to 10

   replace   pm_cod with str(i,2),;

             pm_nome with  "Marcos",;

             pm_campodt with "111298"

             insert

             if dberr() # 0

               ? dbmens()

             endif

next

return

*************************************************************************

*Altera dados no banco acima

*************************************************************************

prog cargaalt

database  demo 1 a 2

select a

use tabela  

locate

Do While .not. eof()

   replace   pm_nome with  "Bruno"

             modify 

             if dberr() # 0

               ? dbmens()

             endif

  continue

Enddo

return

*************************************************************************

*Exclui dados no banco acima

*************************************************************************

prog cargaexc

database  demo 1 a 2

select a

use tabela  

locate

Do While .not. eof()

             delete

             if dberr() # 0

               ? dbmens()

             endif

  continue

Enddo

return

O arquivo  log.txt que guarda o log referente as transações feitas nos três programas acima, será:

Data-Hora          Ação Arquivo  Prog/Func/Proc       Login      

18/02/2002-18:52:29L        carga                 root                

18/02/2002-18:52:29I    tabela    carga                 root                

18/02/2002-18:52:29U        carga                 root                

18/02/2002-18:52:30L        carga                 root                

18/02/2002-18:52:30I    tabela    carga                 root                

18/02/2002-18:52:30U        carga                 root                

18/02/2002-18:52:30L        carga                 root                

18/02/2002-18:52:30I    tabela    carga                 root                

18/02/2002-18:52:30U        carga                 root                

18/02/2002-18:52:30L        carga                 root                

18/02/2002-18:52:30I    tabela    carga                 root                

18/02/2002-18:52:30U              carga               root                

18/02/2002-18:52:30L              carga               root                

18/02/2002-18:52:30I    tabela    carga               root                

18/02/2002-18:52:30U              carga               root                

18/02/2002-18:52:30L              carga               root                

18/02/2002-18:52:30I    tabela    carga               root                

18/02/2002-18:52:30U              carga               root                

18/02/2002-18:52:30L              carga               root                

18/02/2002-18:52:30I    tabela    carga               root                

18/02/2002-18:52:30U              carga               root                

18/02/2002-18:52:30L              carga               root                

18/02/2002-18:52:30I    tabela    carga               root                

18/02/2002-18:52:30U              carga               root                

18/02/2002-18:52:30L              carga               root                

18/02/2002-18:52:30I    tabela    carga               root                

18/02/2002-18:52:30U              carga               root                

18/02/2002-18:52:30L              carga               root                

18/02/2002-18:52:30I    tabela    carga               root                

18/02/2002-18:52:30U              carga               root                

18/02/2002-19:04:24L              cargaalt            root                

18/02/2002-19:04:24M    tabela    cargaalt            root                

18/02/2002-19:04:24U              cargaalt            root                

18/02/2002-19:04:24L              cargaalt            root                

18/02/2002-19:04:24M   tabela    cargaalt            root                

18/02/2002-19:04:24U           cargaalt            root                

18/02/2002-19:04:24L           cargaalt            root                

18/02/2002-19:04:24M   tabela    cargaalt            root                

18/02/2002-19:04:24U              cargaalt            root                

18/02/2002-19:04:24L              cargaalt            root                

18/02/2002-19:04:24M   tabela     cargaalt            root                

18/02/2002-19:04:24U              cargaalt            root                

18/02/2002-19:04:24L              cargaalt            root                

18/02/2002-19:04:24M   tabela     cargaalt            root                

18/02/2002-19:04:24U              cargaalt            root                

18/02/2002-19:04:24L              cargaalt            root                

18/02/2002-19:04:24M   tabela     cargaalt            root                

18/02/2002-19:04:24U              cargaalt            root                

18/02/2002-19:04:24L              cargaalt            root                

18/02/2002-19:04:24M   tabela     cargaalt            root                

18/02/2002-19:04:24U              cargaalt            root                

18/02/2002-19:04:24L              cargaalt            root                

18/02/2002-19:04:24M   tabela     cargaalt            root                

18/02/2002-19:04:24U              cargaalt            root                

18/02/2002-19:04:24L              cargaalt            root                

18/02/2002-19:04:24M   tabela     cargaalt            root                

18/02/2002-19:04:24U              cargaalt            root                

18/02/2002-19:04:24L              cargaalt            root                

18/02/2002-19:04:24M   tabela     cargaalt            root                

18/02/2002-19:04:24U              cargaalt            root                

18/02/2002-19:24:00L              cargaexc            root                

18/02/2002-19:24:00D   tabela     cargaexc            root                

18/02/2002-19:24:00U              cargaexc            root                

18/02/2002-19:24:00L              cargaexc            root                

18/02/2002-19:24:00D   tabela     cargaexc            root                

18/02/2002-19:24:00U              cargaexc            root                

18/02/2002-19:24:00L              cargaexc            root                

18/02/2002-19:24:00D   tabela     cargaexc            root                

18/02/2002-19:24:00U              cargaexc            root                

18/02/2002-19:24:00L              cargaexc            root                

18/02/2002-19:24:00D   tabela     cargaexc            root                

18/02/2002-19:24:00U              cargaexc            root                

18/02/2002-19:24:00L              cargaexc            root                

18/02/2002-19:24:00D   tabela     cargaexc            root                

18/02/2002-19:24:00U              cargaexc            root                

18/02/2002-19:24:00L              cargaexc            root                

18/02/2002-19:24:00D   tabela     cargaexc            root                

18/02/2002-19:24:00U              cargaexc            root                

18/02/2002-19:24:00L              cargaexc            root                

18/02/2002-19:24:00D   tabela     cargaexc            root                

18/02/2002-19:24:00U              cargaexc            root                

18/02/2002-19:24:00L              cargaexc            root                

18/02/2002-19:24:00D   tabela     cargaexc            root                

18/02/2002-19:24:00U              cargaexc            root                

18/02/2002-19:24:00L              cargaexc            root                

18/02/2002-19:24:00D   tabela     cargaexc            root                

18/02/2002-19:24:00U              cargaexc            root                

18/02/2002-19:24:00L              cargaexc            root                

18/02/2002-19:24:00D   tabela     cargaexc            root                

18/02/2002-19:24:00U              cargaexc            root                

OpenBASE! o Banco de Dados Inteligente Anterior Sumário Fale conosco! Próximo