Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Conditional Insert
Message
De
01/11/2015 13:58:59
John Ryan
Captain-Cooker Appreciation Society
Taumata Whakatangi ..., Nouvelle Zélande
 
 
À
30/10/2015 04:36:12
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows 10
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01626580
Message ID:
01626798
Vues:
63
>>The gather in a function is actually the only simple and elegant solution that I saw here. Besides, there's no danger of overstepping any outside variables, as parameters always hide any variable with the same name existing in the caller or above. This has been so since the days of foxplus (learned that the hard way).

Sure- we all had to understand the whole pass by value/reference in the days when the number of variables was limited and passing by value could double the number. Open dbfs/cursors was worse- not everybody will remember when the number of open aliases was limited to 25! For nostalgia, consider that myalias->myfield works to this day.

I thought of another way to abstract the scenario: standardize your Views with blank placeholder fields- e.g.
select *,space(25) as FIELD1...
so you can insert or replace at will. That's assuming there isn't a way to avoid the issue in the first place!

However, it sounds as if the issue was solved with a single IF with 2 insert statements which isn't so tough to maintain.
"... They ne'er cared for us
yet: suffer us to famish, and their store-houses
crammed with grain; make edicts for usury, to
support usurers; repeal daily any wholesome act
established against the rich, and provide more
piercing statutes daily, to chain up and restrain
the poor. If the wars eat us not up, they will; and
there's all the love they bear us.
"
-- Shakespeare: Coriolanus, Act 1, scene 1
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform