You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

19 lines
392 B

const nome = _req.getString("nome") ?? "";
const dbRegistros = _db.query(`
SELECT nome, c_r_m
FROM medico
WHERE nome LIKE '%${nome}%'
`);
const lista = _val.list();
for (const dbRegistro of dbRegistros) {
lista.add(
_val.map()
.set("nome", dbRegistro.getString("nome"))
.set("CRM", dbRegistro.getString("c_r_m"))
);
}
_out.json(lista);