Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Duplicate ids
Message
 
 
À
28/06/2001 08:34:38
Christian Cote
Les Logiciels Onoma Inc.
Longueuil, Québec, Canada
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Titre:
Divers
Thread ID:
00524612
Message ID:
00525134
Vues:
17
Christian,
This task really has nothing to do with foxpro but if you fill more comfortable with VFP than why not.
If you decide to do it in oracle you can find CREATE SEQUENCE very usefull in your case.

>HI,
>I need to update an Oracle table that has a duplicate id key but the subid (foreing key) is unique. I need to clean up the duplicate keys with something like SELECT MAX(id) FROM MyTable. After it, I was thinking that I could create a remote view like :
>
>CREATE VIEW MyView REMOTE MyConnection AS ;
>SELECT SubId, Id FROM MyTable WHERE Id IN ;
> (SELECT Id FROM MyTable GROUP BY Id HAVING COUNT(*) > 1)
>
>After making the view updatable, I would iterate into it and for each id:
>- get the first Id
>- Update the subsequent Id with the previous Max(Id) retreived by the select statement at the beginning of this message.
>- Send the update to Oracle.
>
>Is there a simpler way to achieve this ? Maybe it would be better to code in PL/SQL but I have the feeling that VFP will (again) make my life easier. I use VFP6 SP5 and Oracle 8.1.5.
>
>Thank you for your help,
>Christian Cote
--sb--
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform