Diese Seite mit anderen teilen ...

Informationen zum Thema:
WinDev Forum
Beiträge im Thema:
Erster Beitrag:
vor 8 Jahren, 2 Monaten
Letzter Beitrag:
vor 8 Jahren, 2 Monaten
Beteiligte Autoren:
jem, issah, Glenn Rathke, Paulo Oliveira

problem with query (mysql native)

Startbeitrag von jem am 27.05.2010 20:27

I having strong problem running query with multiple join .

left outer join table2 on (table2.field1 = table1.field2)
left outer join table3 on (table3.field1 = table1.field3)
table1. field1 = '1'

I keep getting sql syntax error when I run the query on windev . but I don't get any error when I run it directly on mysql console.

if I remove the where statement then windev can run.

what should I do to solve this?


You must be using "hExecuteSQLQuery", please include the "hQueryWithoutCorrection" as one of the options.

Hope thats it.



von issah - am 27.05.2010 21:12
Thank for your suggestion but it doesn't work .

I not using hExecuteSQLQuery , just a normal hexecutequery .

I also having same error when I run the query on windev .

my guess is this is a bug in mysql native access .

I hope any alt suggestion to solve this

von jem - am 27.05.2010 21:25
in hexecutequery you can use hQueryWithoutCorrection as well.
I don't use MYSQL but in SQLSERVER and ORACLE the native access have problems with complex query.

PS: When you use hQueryWithoutCorrection be careful with date / time fields, i don't know MYSQL but in SQLSERVER you always get datetime fileds instead if date.

von Paulo Oliveira - am 28.05.2010 08:49
Hi Jem,

Do you have control of the DB. If so can you you create the view on the server? From there it is a simple matter of importing the view into the analysis.

von Glenn Rathke - am 28.05.2010 12:04
>> Paulo Oliveira
thanks for your the suggestion.

I tried but encounter another problem.
1. I using NULL to switch on and off the parameters of query . this create problem when I using hQueryWithoutCorrection .

2, tabledisplay with taReexecutequery also create error

von jem - am 28.05.2010 15:18
Go with Glen's suggestion, create a view on the server, then import the specifications. The analysis will see it as a table. That is often the best way to handle complex queries.


von issah - am 29.05.2010 11:27
I guess you're right .

another way is to divide into 2 query .

I did a test and found that using view is much much faster than using 2 query .

von jem - am 30.05.2010 01:20
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.