Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to loop a query result in script-code

Status
Not open for further replies.

Gijza

Programmer
Nov 23, 2005
1
NL
hi all,
i'm new to powerbuilder (10) and i have a question.i have made the following query, that does what i want:

gewenste_begindatum = Date(sle_datumaankomst.text)
gewenste_vertrekdatum = Date(sle_datumvertrek.text)

Select "plaats"."plaatsid" INTO :teller
From "plaats"
WHERE "plaats"."plaatsid"
NOT IN (
Select "boeking"."plaatsid"
FROM "boeking"
WHERE (:)gewenste_begindatum > "boeking"."begindatum" AND :gewenste_begindatum < "boeking"."einddatum")
OR :)gewenste_vertrekdatum > "boeking"."begindatum" AND :gewenste_vertrekdatum < "boeking"."einddatum"))
OR :)gewenste_begindatum < "boeking"."begindatum" AND :gewenste_vertrekdatum > "boeking"."einddatum"));

this query works perfectly! it returns the result of a search.
the result of the query should be shown in a listbox which can be done by:
lb_listboxname.additem(string)

but i can't find out how the loop the result of the query.. if that is even possible ??

the 2 sle_name are singleLineEdits :)

is there is an other solution to this problem i'm happy to hear about them! mabye another control or so??

tnx in advance
Gijza
 
Hey Gijza!

Powerbuilder relies heavily on it's DataWindow - Technology to work with databases.

My Proposal:

Use an invisible DataWindow called DataStore, give it a DataWindowObject with your Query and access the results of the Query after o_datastore.retrieve() via o_datastore.row[rowindex].col_name.

Was this helpfull?

Bye.

__________________________________________
a programmer is a tool that converts coffee into code...
aschi666, sthcomputing.de
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top