PC SOFT

PROFESSIONAL NEWSGROUPS
WINDEVWEBDEV and WINDEV Mobile

Home → WINDEV 2024 → UNION on HExecuteSQLQuery()
UNION on HExecuteSQLQuery()
Started by Alejandro Santacatalina, Oct., 20 2017 6:01 PM - No answer
Posted on October, 20 2017 - 6:01 PM
Hello,
I have 3 tables and I want to show the columns from t1 that have the Column1 value on the t2 or t3. I try an Union sql sentence but it seems like not works with HExecuteSQLQuery().

The query is something like this:
cQry is string = [
SELECT t1.Column1, t1.Column2 FROM t1 JOIN t2 on t1.Column1 = t2.Column1
UNION
SELECT t1.Column1, t1.Column2 FROM t1 JOIN t3 on t1.Column1 = t3.Column1
]

The function:

HExecuteSQLQuery(DataSource, hQueryDefault, cQry)
HReadFirst(DataSource)

Finally I had an Error on HReadFirst(), DataSource is null.

Thank you!