UpdateDB Statement
Updates the data in the table which is retrieved in the opened data base.
Syntax
UpdateDB #DBNumber, item, value
Parameters
- fileNumber
- Specify the database number (integer value from 501 to 508) specified in OpenDB.
- item
- Specify an item name of the table to update.
- Value
- Specify a value to be updated.
Description
Updates the data in the table which is retrieved in the opened data base with the specified value.
Before updating the data, it is required to issue SelectDB and select the record to be updated.
Note
- Connection of PC with installed RC+ is required.
See Also
OpenDB,CloseDB, SelectDB, DeleteDB
UpdateDB Statement Example
Example using SQL database
Following is an example to register the data to the table “Employees” in the sample database “Northwind” of SQL server 2000, and update the items in the registered data.
Integer count, i, eid
String Lastname$, Firstname$, Title$
OpenDB #501, SQL, "(LOCAL)", "Northwind"
count = SelectDB(#501, "Employees", "TitleOfCourtesy = 'Mr.'")
Print #501, "Epson", "Taro", "Engineer", "Mr."
count = SelectDB(#501, "Employees", "LastName = 'Epson' and FirstName = 'Taro'")
Input #501, eid, Lastname$, Firstname$, Title$
Print eid, ",", Lastname$, ",", Firstname$, ",", Title$
UpdateDB #501, "Title", "Chief Engineer"
count = SelectDB(#501, "Employees", "LastName = 'Epson' and FirstName = 'Taro'")
Input #501, eid, Lastname$, Firstname$, Title$
Print eid, ",", Lastname$, ",", Firstname$, ",", Title$
CloseDB #501