Hi Jeffrey,
as far as I know, a foundset is always something in memory, as it represents a (desired / filtered) subset of the physical database table.
(There can be a foundset without physical table, but I guess that is not something you had in mind.)
Maybe you want to say "I want to update one column in my memory foundset without updating the whole table." ?
In that case you would loop through the foundset, which would look like this.
Note that the getSize() function in the for loop will make sure that all records will be changed, and not only the first 200 (or 70 or whatever) in the foundset which will be loaded initially.
- Code: Select all
for (i = 1; i <= fs.getSize(); i++) {
rRec = fs.getRecord(i);
rRec.yourFieldName = "yourNewValue";
}
My personal preference is to not use such a loop in cases where I have to update a lot of records (which happens seldom), as they are slower than SQL, but to use just plain SQL UPDATES inside Servoy, like this (sSQL contains the SQL-Query-String):
- Code: Select all
plugins.rawSQL.executeSQL(scopes.utils.DB.SERVER, null, sSQL);