Code: Select all
put "select email from borrowers where borrowers.userID = (select max(userID) from borrowers)" into tSQL
put revdb_querylist (,,gConID, tSQL) into tList
handleRevDBerror tList
if the result is not empty then
answer warning "Didn't get email address from borrowers table " &tList
exit mouseUp
end if
put "select prop_addr from borrowers where borrowers.userID = (select max(userID) from borrowers)" into tSQL
put revdb_querylist (,,gConID, tSQL) into tList2
handleRevDBerror tList2
if the result is not empty then
answer warning "Didn't get property address from borrowers table " &tList2
exit mouseUp
end if
put "select * from temp_deals" into tSQL
put revdb_querylist (,,gConID, tSQL) into tList3
handleRevDBerror tList3
if the result is not empty then
answer warning "Didn't get mortgage information " &tList3
exit mouseUp
end if
put "Mortgage availability for " & tList2 into tList2
put "Loan Program Interest Only Interest Rate Monthly Payment" into tHeader
put tHeader & return & tList3 & return & return & return & "Thank you," & return & return & return & return & "Peter Koppelman" into tList4
revMail tList,, tList2, tList4
end mouseUp
on handleRevDBerror pError
switch
case item 1 of pError is "revdberr"
return "There is a revDB Error: " &pError
break
case "syntax error" is in pError
return "There is a database Error: " &pError
break
end switch
end handleRevDBerror
2) I can't figure out how to create headers when I extract information from the temp_deals table. I know that there is a ".headers on" command in SQLite, but I can't figure out how to tell SQLite through Livecode to do this.
3) I've created a header line in the body of my email. How do I format the information that I've retrieved from the temp_deals table to line up with the header? It would be nice if the person that I'm sending the email to could read the information easily.
Thanks,
Peter