Dirk
|
Posted: 02/08/2004, 12:15 PM |
|
I have an editable grid with a coule of labels and a delete-checkbox. Since I use e few left-joins in the datasource, I need to use a custom-delete. I used an SQL statement "DELETE FROM tbl_name WHERE field = {id}" with {id} defined.
CCS [2.2.3.60] adds "LIMIT 0, 100" to this statement, resulting in an error message! Why does CCS add this, and how do I remove it?
Any help would be appreciated
|
|
|
Nicole
Posts: 586
|
Posted: 02/09/2004, 6:02 AM |
|
Dirk,
How you can repeat it? I cannot get the same results. What are the settings of "id" parameter and what exact sql you get?
_________________
Regards,
Nicole |
|
|
peterr
Posts: 5971
|
Posted: 02/09/2004, 2:30 PM |
|
Sorry, I also don't understand this problem and don't know why CCS would add such code to your SQL statement.
Please contact our support (link below) for more detailed analysis.
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com |
|
|
Dirk
|
Posted: 02/13/2004, 3:11 AM |
|
Probably without realizing it yourself, you gave me a very helpfull answer!
I inflicted this problem myself by adding a custom query function to class clsDBdbConn extends DB_MySQL (common.php)
I have overridden the standard query function to speed up database traffic; since I work with different servers for my databases and my website and I have tables with 10.000+ records, I thought it a bit useless to retrieve 10.000 records to display only (let's say) 25 of them...
The error I made was not checking for 'select' statements, which is corrected in the code here-below.
I'm curious to your reaction; would this bit of code be a good addition to CCS in the future?
Regards, Dirk
===============
function query($Query_String) {
if (isset($this->PageSize) && isset($this->AbsolutePage) && strtolower(substr($Query_String,0,6) == "select")) {
if ($this->PageSize != 0 && $this->AbsolutePage != 0 && $Query_String != CCBuildSQL($this->CountSQL, $this->Where, "")) { $limit = " LIMIT ".(($this->AbsolutePage - 1)*$this->PageSize).",".$this->PageSize;
} else {
$limit = "";
}
} else {
$limit = "";
}
parent::query($Query_String.$limit);
}
|
|
|
peterr
Posts: 5971
|
Posted: 02/13/2004, 9:59 AM |
|
Without analyzing and testing your code in detail, I don't know how/if it will work with all components in CCS.
However, we are planning to add LIMIT support for MySQL.
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com |
|
|
peterr
Posts: 5971
|
Posted: 02/13/2004, 4:26 PM |
|
Dirk,
I just obtained information that we plan to implement LIMIT within a week or two and release an update.
(there are related issues/tasks, regarding implementing this with custom SQL, as well as in ASP, Java, .NET, etc.)
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com |
|
|
Dirk
|
Posted: 02/22/2004, 2:43 AM |
|
Great! In my (humble) opinion the above solution works great; i'm curious to the solution of the real guru's !
|
|
|
|