- Timestamp:
- 07/23/11 11:25:38 (12 years ago)
- Branches:
- master, qt5
- Children:
- 3b51342
- Parents:
- 274f6dc
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sql/sqlengine.cpp
r274f6dc r1dbb3bb 262 262 //LOG_AUTOTEST(query); 263 263 } 264 // check if event is already there, i.e. room name changed 264 265 // remove previous conference/room records; room names might have changed 265 266 query = QSqlQuery(db); 266 query.prepare(" SELECT *FROM EVENT_ROOM WHERE xid_conference=:conference_id AND xid_event=:event_id");267 query.prepare("DELETE FROM EVENT_ROOM WHERE xid_conference=:conference_id AND xid_event=:event_id"); 267 268 query.bindValue(":conference_id", aRoom["conference_id"]); 268 269 query.bindValue(":event_id", aRoom["event_id"]); 269 270 if (!query.exec()) qDebug() << "Could not execute SELECT * FROM EVENT_ROOM' query:" << query.lastError(); 270 if(query.next()) // event/conference exists --> delete it 271 { 272 query.prepare("DELETE FROM EVENT_ROOM WHERE xid_conference=:conference_id AND xid_event=:event_id"); 273 query.bindValue(":conference_id", aRoom["conference_id"]); 274 query.bindValue(":event_id", aRoom["event_id"]); 275 if (!query.exec()) qDebug() << "Could not execute SELECT * FROM EVENT_ROOM' query:" << query.lastError(); 276 } 271 // and insert new ones 277 272 query = QSqlQuery(db); 278 273 query.prepare("INSERT INTO EVENT_ROOM (xid_conference,xid_event,xid_room) VALUES (:conference_id, :event_id, :room_id)");
Note: See TracChangeset
for help on using the changeset viewer.