Re: 30,000 MySQL queries...
Posted by:
MySQL Hero
Date: September 16, 2005 03:23PM
Each query is run through a single SQL statement handle. Each query is unique. I'm running this localhost on a development PC with all the usual amenities - IDE, debugger, etc. Each SQL statement is prepared and then executed using SQLPrepare and the SQLExecute calls respectively.
Sample SQL queries below (field names changed to protect the target application):
Query = "SELECT *\r\n";
Query += "FROM Fi, FiType\r\n";
Query += "WHERE Fi.FiType_ID = FiType.FiType_ID\r\n";
Query += " AND Fi_Sig_X = '" + SQLSig + "'";
...Executes the query...if no result...executes a different select query...if no results...<repeats a few times>
If it fails to find the information...
Query = "INSERT INTO Fi (FiType_ID, Fi_NM,\r\n";
Query += " Fi_Sig_X, Fi_Co_X,\r\n";
Query += " Fi_V_X, Fi_FiSize_X,\r\n";
Query += " Co_ID, Fi_Desc_X,\r\n";
Query += " Fi_Count_NB, Fi_TL_NB, Fi_DU_F,\r\n";
Query += " Fi_DD_X, Fi_DR_F)\r\n";
Query += "VALUES (" + DBQuery3.GetColumn("FiType_ID") + ", '" + SQLFi + "',\r\n";
Query += " '" + SQLSig + "', '" + SQLCo + "',\r\n";
Query += " '" + SQLV + "', '" + SQLFiSize + "',\r\n";
Query += " " + DBQuery2.GetColumn("Co_ID") + ", '" + SQLDesc + "',\r\n";
Query += " 0, " + CString(y) + ", 0, ' ', 0)";
Executes.
See...nothing fancy. Just some select, insert, and update queries.