|
Updates the current database record of NAME db_alias, with the contents of the database fields.
When you are working with a database, Miva Script maintains a record pointer to the current record. A record becomes the current record when you navigated to it using <MvFIND>, <MvGO>, or <MvSKIP>. You will need to navigate to the records you want to change before updating. Attributes
ExamplesMiva Script creates database variables in the form alias.d.fieldname that correspond to the fields of the current record in each open database, and it is through these variables that your program can read and write the data in the record. In this example, the database is opened with <MvOPEN> and the desired record is found with <MvFIND>. Then values are assigned to two variables corresponding to the title and salary fields in the employees database: employees.d.title is set to 'Director' and employees.d.salary is set to '250000'. Finally <MvUPDATE> stores these values in the current record, overwriting the previous data. Example:<MvOPEN NAME="employees" DATABASE="{ g.path $ 'workers.dbf' }" INDEXES="emp_name.mvx"> <MvFIND VALUE="Jeeves"> <MvIF EXPR="{ NOT employees.d.EOF }"> <MvASSIGN NAME="employees.d.title" VALUE="Director" <MvASSIGN NAME="employees.d.salary" VALUE="250000"> <MvUPDATE> </MvIF> <MvCLOSE NAME="employees"> <MvUPDATE> locks the record that is being updated. |