How can i get the result of a query and use it another?
I have a db table which represents a recipe. when the user adds a row to the table I would like to automatically increment the “step No”. when adding the new row.
I am using the following Query to get the number of steps:
GetStep = “Select Count(StepNo) From %s” % (RecipeName)
NextStep = system.db.runQuery(GetStep, ‘Recipes’)
The query itself works but NextStep does not contain the value, at least not in a useable form to perform the “insert Into” query like:
Query = “Insert Into template (StepNo) Values (%s)” % (NextStep)
#system.db.runUpdateQuery(Query, ‘Recipes’)
Thanks for any help.
Scott