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
#8
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
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 Erwin van der Zwart - 20.09.2019, 19:40
RE: SQL challenge yet again - by Trond Hoyem - 25.09.2019, 06:33

Forum Jump: