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.

Using values from lUA in SQL lookup
#3
(30.01.2019, 13:20)admin Wrote: Why not just use some addressing rules between source and control objects? Like 1/X/1 and 1/X+1/1?
Your script should probably look like this:
Code:
nyGA = db:getall('SELECT name FROM objects WHERE name LIKE "%' .. room .. '%" AND name LIKE "%set auto%"')

Well, the project is existing, and there are no such rules there. I do not want to redesign it all together.

On the other hand, I am no big fan of rules like that as the rule always fail as there is always one or more rooms/ functions that do not fit the rule. Good naming usually works much better imo.

The fix you gave me did it BTW! Thanks a lot!

One more issue here:

I can't seem to find the object name. When I am logging the result from the DB i get something that to me looks like a table within a table:
manInput 30.01.2019 14:30:26
* table:
[1]
* table:
[name]
* string: 3407 landskap lys set auto

The string called [name] is correct, but how to I get to it? When I log the result like this;
nyGA = db:getall('SELECT name FROM objects WHERE name LIKE "%' .. room .. '%" AND name LIKE "%set auto%"')
log(nyGA)
ga = nyGA.name
log(ga)

I get nil in return.
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
RE: Using values from lUA in SQL lookup - by Trond Hoyem - 30.01.2019, 13:25

Forum Jump: