Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
INSERT not as maintainable?
Message
De
27/07/2006 11:59:02
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
01140411
Message ID:
01140739
Vues:
21
Thanks for sharing Naomi, I grabbed it for future use! :o)


>>>mine is a specific reason why i've started using insert more than replace.
>>>
>>>What I have found with doing an audit trail is that each replace command adds a row to my audit table, which if i'm replacing a number of fields at one time (say for example with a "save" button on a form), i get a number of rows in my table for the same "save" command. with the insert command, i get only one row which makes it much much easier for me to track changes made to my tables.
>>
>>Does this happen if you buffer the record and do a tableupdate?
>
>Here is a little handy function I use to get field list for inserts, CA, etc.:
>
>
>********************************************************************
>*  Description.......: FieldsToString - creates a string with fields in a table
>*  Calling Samples...:
>*  Parameter List....: tlAddTypes, tlAddAlias
>*  Created by........: Nadya Nosonovsky 04/21/2005
>*  Modified by.......: *-- CHANGE - NN - August 10, 2005 - 15:10:45
>********************************************************************
>function FieldsToString
>lparameters tlAddTypes, tlAddAlias
>
>local lcStr, lnI, lnFields, laFields[1], lcType
>lnFields = afields(laFields)
>lcStr = ""
>
>for lnI = 1 to m.lnFields
>	lcType = laFields[m.lnI,2]
>	lcStr = m.lcStr + ", " + iif(m.tlAddAlias,alias() + ".", "") + ;
>		lower(left(laFields[m.lnI, 1],1)) + ;
>		proper(substr(laFields[m.lnI, 1],2)) + ;
>		iif(m.tlAddTypes, " " + m.lcType + ;
>		iif(not inlist(m.lcType, "D","T","I","G","M","Y"), "(" + transform(laFields[m.lnI,3]) + ;
>		iif(laFields[m.lnI,4] > 0, ", " + transform(laFields[m.lnI,4]),"") + ")",""),"")
>next
>_cliptext = substr(m.lcStr, 3)
>*******************************************************************************
>
.·*´¨)
.·`TCH
(..·*

010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform