use("ODBC"); var people = {}; people["authur"] = 30; people["ford"] = 42; people["trillian"] = 29; people["zaphod"] = 304; people["marvin"] = 1000001; db = new ODBC("freeswitch", "", ""); if (!db.connect()) { exit(); } db.exec("create table demo (name varchar(255), age varchar(80));"); for (var i in people) { //sql = "insert into demo values('\"" + i + "\"', " + people[i] + ");"; sql = "insert into demo values('" + i + "', " + people[i] + ");"; console_log("debug", sql + "\n"); db.exec(sql); } sql = "select * from demo;"; //sql = "select contact from sip_registrations where user='tony' and host='destroyer.freeswitch.org'"; var line = "==============================\n"; console_log("notice", line); db.exec(sql); console_log("debug", "ok " + db.numRows() + "\n"); while(db.nextRow()) { var row = db.getData(); for (var i in row) { console_log("debug", "[" + i + "] = [" + row[i] + "]\n"); } console_log("debug", "\n"); } console_log("notice", line); db.exec("drop table demo");