I have a number of records where the “catkey” field contains data such as “L1”, “L1L2”, “L1L2L3”, “L2”, L2L2", etc. I’m attempting to construct a SQL query where I’ll select all records starting with “L1”. I DON’T know how many variations there may be. Therefore I believe I should use a wildcard.
I can manually enter Find mode and successfully search for “L1%”. That works. But the following does not:
var key = 'L1';
key = key + '%';
var maxReturedRows = 1000;
var query = "SELECT catitemid FROM catitem WHERE catkey = '" + key + "' ";
var dataset = databaseManager.getDataSetByQuery(controller.getServerName(), query, null, maxReturedRows);
controller.loadRecords(dataset);
I’m misunderstanding the required syntax.