[WD20] Passing a Query as a Parameter

Startbeitrag von Curtis am 06.07.2015 16: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)

Antworten:

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

von ICI - am 06.07.2015 21:42
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.

von Curtis - am 07.07.2015 13:53
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.