loadrecords(fs)

hi!

would like to seek help on this. mainTableFoundset.loadRecords(tempTableFoundset) return false. i am using servoy6. no errors in the log. =(

function onActionRestore_DB() {
	databaseManager.setAutoSave(false);
	
	createTempTable("customercontact","TEMP_customercontact");
	
	var mainTableFoundset = databaseManager.getFoundSet(dbServerName,"TEMP_customercontact")
	var tempTableFoundset = databaseManager.getFoundSet(dbServerName,"customercontact")
	
	tempTableFoundset.loadAllRecords();
	mainTableFoundset.loadRecords(tempTableFoundset)
	databaseManager.saveData(mainTableFoundset)
function createTempTable(tableName, tempTable) {
	
	var server = plugins.maintenance.getServer(dbServerName);		
	var tempTableObject = server.createNewTable(tempTable);
	var mainTable = server.getTable(tableName);
	var mainTableColumns = mainTable.getColumnNames();
	for (var indexMainTableColumns = 0; indexMainTableColumns < mainTableColumns.length; indexMainTableColumns++) {
		var mainTableColumn = mainTable.getColumn(mainTableColumns[indexMainTableColumns])
		tempTableObject.createNewColumn(mainTableColumn.getSQLName(),mainTableColumn.getType(),mainTableColumn.getLength(),mainTableColumn.getAllowNull(),mainTableColumn.isRowIdentifier())
	}
	return server.synchronizeWithDB(tempTableObject)
}

rogel,

You can only copy from one foundset to the other when both have the same data source.

Why do you have to work in a temp table?

I guess with autosave off you could also work in a foundset in the main table, all updates/inserts (not deletes!) are postponed until save.

Rob

rgansevles:
rogel,

You can only copy from one foundset to the other when both have the same data source.

Why do you have to work in a temp table?

I guess with autosave off you could also work in a foundset in the main table, all updates/inserts (not deletes!) are postponed until save.

Rob

I am doing a web service restore (full/partial data) from a backup SQL files functionality. We have 100+ tables to restore. I am doing a temp table to process(delete and inserts from backup SQL file, and possible update if the insert fails if pk exists) before I return to the main table.