Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQl com 6 tabelas
Message
From
06/09/2002 07:19:22
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
 
To
06/09/2002 06:50:57
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00697409
Message ID:
00697417
Views:
15
>Pessoal
>
>Para permitir que o usuário apague um artigo , eu tenho que verificar em 6 tabelas se esse artigo existe lá .
>Basta existir em apenas uma dessas tabelas , e eu não posso deixar apagar esse artigo .
>A pergunta é , tenho que fazer 6 SELECT SQL , ou basta fazer um ?
>
>No caso de bastar fazer um SELECT SQL , como seria a estratégia ?
>
>Muito obrigado aos nossos treinadores em SELECT SQL .

Se a referential integrity estiver corretamente definida, VFP nao vai deixar voce apagar um registro (record), havendo registros relacionados em outras tabelas. Se nao usa buffering, o DELETE nao terá éxito. Se usar buffering, TableUpdate() depois do DELETE nao terá éxito.

E muito mais fácil deixar esto para VFP, a través da referential integrity.

Veja http://www.levelextreme.com/Magazine/June2002/Page21.asp.

Hilmar.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Reply
Map
View

Click here to load this message in the networking platform