PC SOFT

FOROS PROFESIONALES
WINDEVWEBDEV y WINDEV Mobile

Inicio → WINDEV 2024 → HReadSeekFirst on two parameters
HReadSeekFirst on two parameters
Iniciado por Christine schokkaert, 27,dic. 2004 17:19 - 2 respuestas
Publicado el 27,diciembre 2004 - 17:19
I want to write in code a select statement
select * from tzipcodes where zcZipcode=Combo_TZipcodes and zcCountryCode=Combo_CountryCode
I want to use this HReadSeekFirst
But this is for only one key...
HReadSeekFirst(TZipCodes,zcZipCode,Combo_TZipCodes)
How can i do this for where zcZipcode=Combo_TZipcodes and zcCountryCode=Combo_CountryCode
I want to do this in code so not with the Query builder and save the query.
Publicado el 27,diciembre 2004 - 17:31
Hello,
2 options:
1st:
HExecuteSQLQuery("Foo","Delete from tzipcodes where zcZipcode= '" + Combo_TZipcodes + "' and zccountrycode = '" + combo_TCountrycode + "'")
2nd:
Create a composite key in your analysis in TZipcodes on zcZipcode and zccountrycode.
Then you can do a hreadseekfirst (in combination with hbuildkey) to search on that combined key.
Greetings
I want to write in code a select statement
select * from tzipcodes where zcZipcode=Combo_TZipcodes and zcCountryCode=Combo_CountryCode
I want to use this HReadSeekFirst
But this is for only one key...
HReadSeekFirst(TZipCodes,zcZipCode,Combo_TZipCodes)
How can i do this for where zcZipcode=Combo_TZipcodes and zcCountryCode=Combo_CountryCode
I want to do this in code so not with the Query builder and save the query.



Webstek:
Publicado el 30,diciembre 2004 - 13:28
Hi Christine,
You can use:
Hfilter(TZipCodes,zcZipCode,Combo_TZipCodes,Combo_TZipCodes,"zcCountryCode='"+Combo_CountryCode+"'"))
HreadFirst(TZipCodes,zcZipCode)
if hout(TZipCodes) then
//no match found
else
//match found
//process all
while not hout(TZipCodes)
//do your thing
hreadnext(TZipCodes,zcZipCode)
end
end
//don't forget to deactivate
hdeactivatefilter(TZipCodes)
best regards,
Piet