1
I wish to move on to the function execSQL
the name of the variable I want to use in
base.consulta()
and from the string SQL, directly pass the variable to the function base.consulta()
, that is, pass the variable that has the same name as the string.
An example for you to have an idea of what I’m looking for.
OBS: I know the way it is doesn’t work and I know why.
// variáveis com algum SQL
string sqlConsultaEspecifica = "...";
string sqlMonitoramento = "...";
string sqlVerificacao = "...";
function execSQL(string sql = "sqlMonitoramento") {
// ...
// realizar algumas ações aqui
// ...
return base.consulta(sql);
}
Is it possible to do this? How could I do this?
Create a class, add the sql commands in constants, by calling the function pass the constant in the parameter, equivalent to what @Maniero said below.
– Barbetta