Page 285 in user's guide refers to the following ==
put revGetSQLQuery and revSetSQLofQuery
Where are these found and how does one use them?
Where are DB commands
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- VIP Livecode Opensource Backer
- Posts: 977
- Joined: Sat Apr 08, 2006 7:47 am
- Contact:
Hi Don,
This pair of function and command pertain to automated database queries - where you use the Database Query Builder to setup a connection to a database and define a number of fixed queries.
Once you have setup the queries, you can lay out fields, checkboxes and other controls, and link them to those queries to display and edit individual columns - and buttons to traverse the query result set, refreshing the linked controls to display the data of the current record in the result set.
While mainly meant for browsing and light editing of the contents of database records, it can't help you for creating or deleting records; nor can two queries be 'linked' to one another, which would help for 'master-detail' style forms. However, the function and command you mention come to aid for that.
These queries have a name, which you can use to read and alter the SQL query, triggering a refresh of the linked controls. So suppose you have a query "CustomerDetails" with SQL statement
then you can retrieve the SQL by using the function
and you can alter it by using the command
which will cause Revolution to run the new query and update all the linkd controls with the correct data. Neat, isn't it?
HTH,
Jan Schenkel.
This pair of function and command pertain to automated database queries - where you use the Database Query Builder to setup a connection to a database and define a number of fixed queries.
Once you have setup the queries, you can lay out fields, checkboxes and other controls, and link them to those queries to display and edit individual columns - and buttons to traverse the query result set, refreshing the linked controls to display the data of the current record in the result set.
While mainly meant for browsing and light editing of the contents of database records, it can't help you for creating or deleting records; nor can two queries be 'linked' to one another, which would help for 'master-detail' style forms. However, the function and command you mention come to aid for that.
These queries have a name, which you can use to read and alter the SQL query, triggering a refresh of the linked controls. So suppose you have a query "CustomerDetails" with SQL statement
Code: Select all
SELECT * FROM Customer WHERE Customer.cust_Id = 5
Code: Select all
put revGetSQLOfQuery("CustomerDetails") into tSqlQuery
Code: Select all
put 99 into word -1 of tSqlQuery
revSetSQLOfQuery "CustomerDetails", tSqlQuery
HTH,
Jan Schenkel.
Quartam Reports & PDF Library for LiveCode
www.quartam.com
www.quartam.com