GARANTIR DESCONTO

Fórum Deletar em cascata II #188541

14/10/2003

0

Alguém tem um código para excluir registros de uma table filha ligados em um registro da table mãe ?
Estou usando uma banco Paradox

CBier


Cbier

Cbier

Responder

Posts

14/10/2003

Balceiro

cara eu faço o seguinte:


with tabelapai do
first;
   begin
   whith tabelafilho do
   first;
   begin
     while not eof fo
        begin
             delete;
        end;
   end;
delete;
next;
end;


funciona 100¬ de uma maneira muito rápida...


qualquer dúvida mail-me balceiro@bol.com.br....


Responder

Gostei + 0

14/10/2003

Balceiro

delculpe, estava meio bebado quando escrevi este código, agora segue o correto...


with tabelapai do 
begin 
     first; 
     while not eof do
     begin
          with tabelafilha do
          begin
               first;
               while not eof do
               begin
                   delete;
               end;
          end;
     delete; 
     end;
end;



agora acho que funciona testa ai....


Responder

Gostei + 0

14/10/2003

Cbier

valeu. vou fazer o teste.


Responder

Gostei + 0

Utilizamos cookies para fornecer uma melhor experiência para nossos usuários, consulte nossa política de privacidade.

Aceitar