match stmt.exec_direct(&sql_text)? {
Data(mut stmt) => {
let cols = stmt.num_result_cols()?;
while let Some(mut cursor) = stmt.fetch()? {
for i in 1..(cols + 1) {
match cursor.get_data::<&str>(i as u16)? {
Some(val) => print!(" {}", val),
None => print!(" NULL"),
}
}
println!("");
}
}
NoData(_) => println!("Query executed, no data returned"),
}
That makes sense but If I think I have literally hit the wall on this. It's rather difficult at least being a beginner in rust to get the return value top level vs just printing/executing it. In a way I can still do clean up steps to reset params and close cursor. Can anyone help in this regard. Just to see how to go about it would be great. I looked at combinators to achieve this with no success because Data and NoData on ResultSetState
That makes sense but If I think I have literally hit the wall on this. It's rather difficult at least being a beginner in rust to get the return value top level vs just printing/executing it. In a way I can still do clean up steps to reset params and close cursor. Can anyone help in this regard. Just to see how to go about it would be great. I looked at combinators to achieve this with no success because Data and NoData on ResultSetState