Skip to content

About return function #6

@gustavozm

Description

@gustavozm

Hello, sorry for my question.

I'm trying to get the return of the function below, which should return a List with the result of the select and return is null.

Can you help me please.

See function:

queryExec(String tipo, String sql, List param, List valparam) async {
List wret;
connect(uri).then((conn) {
switch (tipo.toUpperCase()) {
case 'SELECT':
{
conn
.query(sql, {param: valparam})
.toList()
.then((result) {
wret = result;
return wret;
})
.then((_) => conn.close())
.catchError((err) => print('Query ERRO: $err'));
break;
}
}
});
// return wret;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions