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

[WD] MySql Query return False ***SOLVED*** (1 reply)

$
0
0
Hello to All

I'm trying to resolve a little problem using this simple query.

This is the code:
//
sSql     	is string 
dsMyQuery 	is Data Source 
bRes        is boolean
bDati       is boolean


sSql="SELECT (SELECT descrizione FROM categoriemerci AS c WHERE c.id=m.`categoria` ) AS categoria, "+...
     " m.codice,m.descrizione, p.`giacenza_iniziale`,p.`carichi`,p.`scarichi`,p.`altri_carichi`,p.`altri_scarichi`"+...
     " FROM magazzino AS m INNER JOIN progressivo_mag AS p ON p.`codice_articolo`=m.codice"+...
     " WHERE p.anno=2017 AND p.deposito=1 ORDER BY categoria, m.descrizione"
    
bRes=HExecuteSQLQuery(dsMyQuery,hQueryDefault,sSql)
IF  bRes THEN
	bDati=HReadFirst (dsMyQuery)
	IF  bDati THEN
		WHILE NOT HOut (dsMyQuery)

			TableAdd (TABLE_Situazione,dsMyQuery.categoria+TAB+dsMyQuery.codice+TAB+dsMyQuery.descrizione+TAB+...
			                           dsMyQuery.codice+TAB+dsMyQuery.descrizione+TAB+dsMyQuery.carichi+TAB+...
			                           dsMyQuery.scarichi)
			                           
			HReadNext (dsMyQuery)
		END
	END
END

//

The execution of this query return FALSE.

But, if i use a MySql tool (like Sqlyog) or i use the internal WDSql tool and try to execute the same query
the result is TRUE with the correct result i want.
See the picture below
[attachment 2275 2017-01-20_17h25_53.png]

Why this different beahviour?

Tips and trick are welcome.

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>