Navigation: Developing Apps > BINETIX® AGE™ API > Plugins > Database Drivers > TDS DB Driver > Functions
update/5
Description
update/5 is an Erlang function exported by "tds" module.
Prepares and executes an UPDATE statement.
The function internally calls execute/4 with default parameters.
References
•execute/4
Parameters
Name
Type
Handle
integer()
Database handle.
Table
atom()
Table name specified as an atom, not a string.
Fields
[]
List of {Name, Value} tuples of the record's fields, where Name is an atom, Value is a term.
Where
string()
String part of the where clause of SQL statement. Defaults to "".
Values
List of substitution terms within the Where clause. Defaults to [].
Result
Value or Type
{sql_result, []}
Code Sample
> tds:update(123456789, users, [{user_name, "Peter"}, {user_age, "23"}], "user_id=?", [1025]).