Code: Select all
# -------------
command populatePropertyDetail pPropertySubType
local tSql
local tSqlQuery, tConnectionID, tSqlResult, tLoginFailed
put false into tLoginFailed
put empty into lgPropertyDetailList
if GetDataBaseID() is empty then
openDatabase GetPlatformDesc()
end if
put GetDataBaseID() into tConnectionID
put "SELECT pd2st.propSubTypeID, pdt.datatype, pd.* " & \
"FROM propertydetail pd " & \
"JOIN propdetail2propsubtype pd2st ON pd.ID = pd2st.propDetailID " & \
"JOIN propertydetailstype pdt ON pdt.ID = pd.propDetailsType " & \
"WHERE propSubTypeID = " & pPropertySubType & \
" AND active = 1" into tSqlQuery
put revDataFromQuery(,,tConnectionID,tSqlQuery) into tSqlResult
if tSqlResult begins with "revdberr" then
put true into tLoginFailed
else
put tSqlResult into lgPropertyDetailList
end if
closeDatabase
end populatePropertyDetail
# -------------
I've tried a few things such as using "Split" and looping through the list but with not much help.
I'm aware one can use revDataFromQuery to place the result into an array but the "JOIN" is causing a mental problem and cant get the syntax correct.
Any pointers would be appreciated or where this has been addressed somewhere on this forum.
# -------------
The result set return from the revDataFromQuerey