Taking results from SQL Query and sending it to a Session Custom Property

I am able to grab data from a SQL Query and have it show up in a table in Perspective. I am able to take the data from the Table and copy it to a Session Custom Property.

Is it possible to do this all in one step? With a press of a button?

Try instead to apply the SQL query binding to the session custom property.
Then bind the table data to that.

In the button action performed…

	self.custom.Result = system.db.runQuery("SELECT * FROM equipment")

That sends the dataset to the custom property ‘Result’ on the button, which then can be be sent to the session custom property bidirectional.

My goal is to create a copy of the table that is retrieved from the Database.

Order of operation may be…

Grab data from Database.

Send it to the Session Custom Properties. If I make changes, I don’t want it to change the data in the database until I send it back.

You're in luck, because that's not how it works.

The query result dataset is an independent copy, and the only way anything goes back to the database is if you script up an insert or update query.

3 Likes

Ahh. So I was worried about something I did not need to be worried about. Thank you everyone for your help!