Good morning,
In changing to the recommended async method I am running into a problem with obtain record set values with dot notation. Previously when using rs = PostgreSQL.select(sql) the values were obtained with rs.id , rs.name , etc.
However using async and closures PostgreSQL.select (sql, onSuccess,onError) a runtime error is generated for rs.id in the onSuccess closure.
Runtime Error
Unable to find id into class Closure
===========
CALL FRAME:
===========
onSuccess (Button1)
Do all the db columns need to be declared in the func onSuccess ?
code snippet :
var material = "Tetric EveCeram"
func onSuccess(db,rs) {
Console.write(rs.id); ---> runtime error
//Label1.text = rs.id;
}
func onError (db) {
var alert = Alert("Error", "Error: \(db.errorMessage)", ["OK"]);
alert.show();
}
PostgreSQL1.connect(onSuccess, onError); // insure conection
var sql = 'SELECT * FROM "Chart_Odont_Material" WHERE "name" = $$\(material)$$';
PostgreSQL1.select(sql, onSuccess, onError);
Thanks
joel