Quantcast
Channel: WinDev Forum
Viewing all articles
Browse latest Browse all 1914

[WD] Limits on Query execution with MySql

$
0
0
Hello to all

I'm trying, without any luck to run this query
sSql                is string
dsMyQuery    is data source
bRes               is boolean
bData             is boolean


sSql="SELECT r.data, G.Descrizione, SUM(r.importo_prestazione) AS tot_imp_prescr, COUNT(*) AS tot_prescr, "
sSql+="(SELECT COUNT(*) FROM registro LEFT JOIN PRESTAZIONI ON REGISTRO.TIPO_PRESTAZIONE=PRESTAZIONI.ID "
sSql+="WHERE REGISTRO.TIPO_PRESTAZIONE = 1  AND REGISTRO.data = R.DATA AND R.ID_GMT=REGISTRO.ID_GMT)  FROM REGISTRO  AS r  "
sSql+=" LEFT JOIN guardie G ON R.id_gmt=g.id " 
sSql+="LEFT JOIN prestazioni AS P ON R.tipo_prestazione = p.ID "
sSql+=" GROUP BY  r.data DESC, G.descrizione ORDER BY r.data DESC"

bRes=HExecuteSQLQuery(dsMyQuery,hQueryWithoutCorrection,sSql)

the result of "bRes" is always False !!
Trying copying/pasting the query to a client (SqlYOG), the query is executed correctly.

Also if i run the query using WDSQL tool, the result is correct and the records are shown.
Why this different behaviour?

Do am i missing something? Wrong parameters? HF query execution limits??

Tips and tricks are very appreciated.

Thanks in advance
Gianni

Viewing all articles
Browse latest Browse all 1914

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>