Dynamic Dataset

This Query works:
system.db.runQuery(select itemdesc from locinv where locid = 1)

This does not work:
InvID = event.source.selectRow + 1
system.db.runQuery(select itemdesc from locinv where locid = InvID)

Please help

You’re going to need to construct the string that’s the argument for system.db.runQuery, or switch to system.db.runPrepQuery (preferred)

InvID = event.source.selectRow + 1
queryString = "select itemdesc from locinv where locid = " + InvID
system.db.runQuery(queryString)

or

InvID = event.source.selectRow + 1
queryString = "select itemdesc from locinv where locid = ?" 
system.db.runPrepQuery(queryString, [InvID])
2 Likes

Thank you so very much, it is now working as I expect.

1 Like