PaidtheUmpire
Programmer
How can you update a database through code in Delphi. Not by entering data yourself.
What i have is a table of X people, with attributes: NAME, LOCATION and VALUE.
Is it possible to set up some code that firstly selects ONLY those people that are in USA [Location = 'USA'], and then using a "random" generated number for each person, update the Value attribute?
Example:
NAME LOCATION VALUE
Rick USA 65
Bill USA 12
Adam ENG 8
So the code would select only Rick and Bill then generate a random variable for each (eg. 9 and 3). A variable of less than 5, would mean that the variable in VALUE would go up 10, while a value of 6 or more would leave the VALUE unchanged.
End of Example:
NAME LOCATION VALUE
Rick USA 65
Bill USA 22 (Up ten from 12)
Adam ENG 8
What i have is a table of X people, with attributes: NAME, LOCATION and VALUE.
Is it possible to set up some code that firstly selects ONLY those people that are in USA [Location = 'USA'], and then using a "random" generated number for each person, update the Value attribute?
Example:
NAME LOCATION VALUE
Rick USA 65
Bill USA 12
Adam ENG 8
So the code would select only Rick and Bill then generate a random variable for each (eg. 9 and 3). A variable of less than 5, would mean that the variable in VALUE would go up 10, while a value of 6 or more would leave the VALUE unchanged.
End of Example:
NAME LOCATION VALUE
Rick USA 65
Bill USA 22 (Up ten from 12)
Adam ENG 8