rename a field, first navigate to the appropriate .data table on the Web Directory tab, click the Design View tab, select the field you wish to rename, and click the Edit link in the Properties
pane. Note that you must manually update the field name
in any views that are bound to the data table.
|Modifying a Field's Definition
can't directly change the data type of a field. However,
you can create a new field with a different data type
and copy all the data from your existing field into your
new field. The DataWeb engine will attempt to convert
all of the data to the new type.
create a new field in your data table with the desired
name and type. Then run a script like the following
one to copy data from your original field to the new
is a sample script to copy data from one field to another:
// This function copies all data from one field in a
// table to another existing field in the same table.
// It includes no error checking. Results are logged
// in the web's Log table.
webcall function copycol(sTable, sFromField, sToField)
var rs = new Resultset(sTable, "*", "*");
var oFields = new Object;
oFields[sToField] = rs[sFromField];
Table.update(sTable, oFields, rs.rowID);
Script.log("Update failed. RowId=" + rs.rowID,
Script.log("Copy Field", rs.getCount() +
" records copied");
//For example, you might run the script as follows:
copycol("Employee", "Home_CellPhone", "HomePhone");
you've run the script, delete the old field from your
data table. Finally, in any views that are bound to the
data table, delete references to the old field and add
references to the new field.