PC SOFT

FOROS PROFESIONALES
WINDEVWEBDEV y WINDEV Mobile

Inicio → WINDEV 2024 → [WD20] Passing a Query as a Parameter
[WD20] Passing a Query as a Parameter
Iniciado por guest, 06,jul. 2015 18:06 - 2 respuestas
Publicado el 06,julio 2015 - 18:06
I have a thread that runs a query to get a list of items. Within that thread I pass the query initialized with data to a procedure that runs on the main thread. Then I add the data to a table control. This all worked fine until I added a paramater to my query. Now when I pass the query, it comes out the other side with no data. The first one works, the second one does not. Both queries gather the right data, but the second one does not pass correctly as a parameter.

IF HExecuteQuery(QRY_ItemList) THEN DisplayTable(QRY_ItemList) RESULT True ELSE RESULT False END IF HExecuteQuery(QRY_ItemList,hQueryDefault,gnCurrentLocation) THEN DisplayTable(QRY_ItemList) RESULT True ELSE RESULT False END
Procedure Code:
PROCEDURE DisplayMemoryTable(plantQuery is Data Source) FileToMemoryTable(WIN_Main.TABLE_ManagePlantTable,plantQuery)
Publicado el 06,julio 2015 - 23:42
First. You have executed query 1st time and need to reExecuteQuery, next time, or you can use hCancelDeclaration(QRY_Item_List) before execute query second time.

IF HExecuteQuery(QRY_ItemList) THEN
DisplayTable(QRY_ItemList)
RESULT True
ELSE
RESULT False
END

hCancelDeclaration(QRY_Item_List)
IF HExecuteQuery(QRY_ItemList,hQueryDefault,gnCurrentLocation) THEN
DisplayTable(QRY_ItemList)
RESULT True
ELSE
RESULT False
END
Publicado el 07,julio 2015 - 15:53
I'm only running one If statement at a time. What I would like to know is why the second one passes an empty data set, but the first one passes a full data set.