SELECT * from А;
while(select_query_->next())
SELECT * from Б where ID_STR = str;
sql_str = "select ID, C1, C2, C3 from TableA";select_query_->setForwardOnly(true);if(select_query_->exec(sql_str)) { while(select_query_->next()) { QString sID = select_query_->value(0).toString(); QString sqlCandidate; sqlCandidate = "select ID, REC1, REC2, REC3 from TableB where ID_STAT = '" + sID + "'"; QSqlQuery* select_candidates = new QSqlQuery(); if (select_candidates->exec(sqlCandidate)) { while (select_candidates->next()) { //действия } } }}
QString create_sql = QString("CREATE TABLE TableA (ID VARCHAR(256) PRIMARY KEY,REQ_START TIMESTAMP,LOCAL_DB VARCHAR(256),REQ_USR VARCHAR(256),LOCAL_IP VARCHAR(256),REMOTE_HOST VARCHAR(256),REQ_TXT VARCHAR(2048),REQ_FINISH TIMESTAMP,N_REPLY INTEGER,REPLY_TXT VARCHAR(6400),ERR VARCHAR(256),STRERR VARCHAR(1024))");
QString create_sql = QString("CREATE TABLE TableB (ID VARCHAR(256) PRIMARY KEY,ID_STAT VARCHAR(256),DB_ID VARCHAR(256),SEG_ID VARCHAR(256),FILE_ID VARCHAR(256),F103 VARCHAR(256),F105 VARCHAR(256),F107 VARCHAR(256),F108 VARCHAR(256),F110 VARCHAR(256),F111 VARCHAR(256),F112 VARCHAR(256),F113 VARCHAR(256),F116 VARCHAR(256),F117 VARCHAR(256),F118 VARCHAR(256),F121 VARCHAR(6400))");