void FrontEnd::OnSongSelected(wxListEvent& event) { string song = event.GetItem().GetText(); string stat = "update songs set state = 1 where name = '" + song +"'"; if( DBExecute(stat) ) wxMessageBox("Song added."); }
HiveResultSet* hdfs_query_execute(HiveConnection *conn, hdfs_opt *opt, char *query) { HiveResultSet *rs = NULL; char err_buf[512]; if (DBExecute(conn, query, &rs, 1000, err_buf, sizeof(err_buf)) != HIVE_SUCCESS) ereport(ERROR, (errcode(ERRCODE_FDW_UNABLE_TO_CREATE_EXECUTION), errmsg("failed to fetch execute query: %s", err_buf))); return rs; }
void FrontEnd::OnNextSong(wxCommandEvent& event) { Songs result; SearchSong("select * from songs where state = 1", result); if(result.empty()) { wxMessageBox("No songs in queue for now.", "Info"); return; } string stmt = "update songs set state = 0 where name = '" + result[0].name + "'"; DBExecute(stmt); wxMessageBox("Switched to next song", "Info"); }