This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

SQL challenge yet again
#9
(20.09.2019, 19:40)Erwin van der Zwart Wrote: Hi,

Here is a simplified version (:

Code:
function deleteGA(start, stop)
  startID = knxlib.encodega(start)
  stopID = knxlib.encodega(stop)
  if stopID < startID then
    log('Start has higher value than stop. Delete is not possible')
  else
    result = db:query('DELETE FROM objects WHERE ID BETWEEN ? AND ?', startID, stopID)
    log(result .. ' address(es) within range is/are deleted')
  end
end

deleteGA('26/0/0', '26/0/10')
deleteGA('26/0/51', '26/0/70')

BR,

Erwin

OK, that is a little more elegant. Smile

Is there any place where one can find all these commands that are used for LM/SL? Like knxlib.encodega()? That would be really helpful to have a list of those, like we have already for the lua commands (https://openrb.com/docs/lua.htm).
There are 10 kinds of people in the world; those who can read binary and those who don't  Cool
Reply


Messages In This Thread
SQL challenge yet again - by Trond Hoyem - 16.09.2019, 13:31
RE: SQL challenge yet again - by Daniel - 16.09.2019, 14:25
RE: SQL challenge yet again - by admin - 16.09.2019, 18:50
RE: SQL challenge yet again - by Trond Hoyem - 17.09.2019, 19:43
RE: SQL challenge yet again - by Trond Hoyem - 20.09.2019, 12:00
RE: SQL challenge yet again - by Daniel - 20.09.2019, 12:02
RE: SQL challenge yet again - by Trond Hoyem - 20.09.2019, 12:09
RE: SQL challenge yet again - by Trond Hoyem - 25.09.2019, 06:33

Forum Jump: