mkm
Posts: 10
|
| Posted: 02/08/2005, 9:07 AM |
|
Hi,
I have a query with subquery in WHERE clause:
SELECT tab_zm_dok.zmId
FROM tab_zm_dok
LEFT JOIN crm.tab_zm_pozycje ON tab_zm_dok.zmId = crm.tab_zm_pozycje.zmId
WHERE
SUM(tab_zm_dok.Szt) > (SELECT SUM(magazyn.tab_zm_pozycje.Szt) FROM magazyn.tab_zm_pozycje WHERE magazyn.tab_zm_pozycje.zmId = tab_zm_dok.zmId)
GROUP BY tab_zm_dok.zmId
I know this is the right query in MySQL, but CCS makes php code like this one:
...
$this->CountSQL = "SELECT COUNT(*) FROM magazyn.tab_zm_pozycje WHERE magazyn.tab_zm_pozycje.zamId = tab_zm_dok.zmId) " .
"GROUP BY tab_zm_dok.zmId";
...
and on the page I have an error:
Database error: Invalid SQL: SELECT COUNT(*) FROM magazyn.tab_zm_pozycje WHERE magazyn.tab_zm_pozycje.zamId = tab_zm_dok.zmId) GROUP BY tab_zm_dok.zmId
MySQL Error: 1064 (Something is wrong in your syntax obok ') GROUP BY tab_zm_dok.zmId' w linii 1)
Session halted.
I know that CCS makes count query to examine the database, but in this moment this is wrong query.
Have You any idea to solve this problem ?
Best regards
|
 |
 |
peterr
Posts: 5971
|
| Posted: 02/08/2005, 10:32 AM |
|
Looks like some part of code is locked, possibly due to manual code modifications. I recommend that you delete the file PageName.php (where PageName is the name of your page), then CCS should be able to regenerate it correctly when you publich again. (please backup your project first)
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com |
 |
 |
mkm
Posts: 10
|
| Posted: 02/08/2005, 2:00 PM |
|

It dosn't work. I think the code generator make a mistake, when he try to calculate the countSQL query from the main query.
|
 |
 |
peterr
Posts: 5971
|
| Posted: 02/08/2005, 2:05 PM |
|
You could try contacting the support and attach that page, so that we could analyze this issue in more detail.
Alternatively, you can use CountSQL property to specify correct SQL. See: http://docs.codecharge.com/studio/html/Components/RTPro...P/CountSQL.html http://forums.codecharge.com/search.php?s_keyword=ds-%3...or=&s_forum[]=5
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com |
 |
 |
mkm
Posts: 10
|
| Posted: 02/08/2005, 2:57 PM |
|

Yes it is. Thank You very much.
Good day (in Poland is exactly 0.00 now :) )
MKM
|
 |
 |
|