Hi Folks - once again I’m thinking I’ve completely lost it! I’ve got this code:
var query = "SELECT "+ columnToUpdate +" FROM " + tableName + " WHERE " + columnToUpdate + " = ?";
var args = new Array();
args[0] = updateWhere;
var myfoundset = databaseManager.getFoundSet(controller.getServerName(), tableName);
myfoundset.loadRecords(query,args);
All the variables are correct, the SQL works fine, the args are showing correct, the foundset is correct (all checked in Debug), yet when it comes to myfoundset.loadRecords(query,args); the solution goes into an infinite loop and the Client freezes (froze developer too one time)!
Sure I’ve done something really stupid but I’m snow blind with it now.
Any ideas on where I’ve tripped up? Really appreciate feedback.
Thanks for the feedback Greg - I had’nt reckoned on that Doh…
Is there an easy way to extract the pk column from a table? This is part of a larger process where we generate the data-dictionary automatically and then use that info in global data change operations. I’ll need to extract the pk from any table selected in this process - or else go back and update the data-dictionary functions to save that data too.
var pkCol = databaseManager.getTable(fs.getServerName(),fs.getTableName()).getRowIdentifierColumnNames()[0];
Thanks Greg - does that assume I already have a foundset on which to base this? Obviously I dont have the actual foundset until I run my SQL (that needs the pk).
Should I therefore build another foundset on all columns and use this to extract the pk before running the SQL I need?