Seelct record from db

Hi!

I need to load an record from DB with a SQL query.

This is my actual code:

/** @type {JSFoundset} */
var _fs = databaseManager.getFoundSet(globals.databaseName,_parTableName)
var query = 'SELECT * FROM '+_parTableName+' WHERE id'+_parTableName+' = ?';

var dataset = databaseManager.getDataSetByQuery(globals.databaseName, query, _parPKs, -1);
_fs = databaseManager.getFoundSet(dataset.createDataSource('memTable'+globals.getUUID()))
_fs.loadAllRecords()

I try also but I have an error:

_fs.loadAllRecords(query, _parPKs)
 com.servoy.j2db.dataprocessing.DataException: ERROR: subquery has too many columns

I need the record stored into the DB, in this way I get it but it’s slow…any suggestion??

thanks

For your second option you must not query for *, just the PK

Is this secure 100% that I get the record from the DB and NOT from the cache?

I’d say yes.

BTW. Reading your post again I see you are using loadAllRecords(). You should use just loadRecords()