How to use database-linked controls

Bill bill at bluewatermaritime.com
Thu Jul 1 15:46:13 EDT 2004




On 6/29/04 11:50 AM, "use-revolution-request at lists.runrev.com"
<use-revolution-request at lists.runrev.com> wrote:

> You can use the same query for a table to show a list
> of records, and individual fields to display details
> -- though you'll have to turn on the Record set
> caching option.
> As for the update problem, I'm sure we'll find it :)


I have been trying to get a LEFT JOIN or any kind of join in a query to work
so that I can see fields from another table when you go through fields in
the main table.

The problem is that you cannot experiment with queries in the query builder.
If you put one in that it does not like then the whole program locks up and
you have to do a force quit (OS X). Please give me an example like this one:

on mouseUp
  put "123456" into tCustomerID # or some field data
  put "SELECT * FROM orders WHERE customerid='" & \
         tCustomerID & "'" into tSQLStatement
  revSetSQLOfQuery "orders",tSQLStatement
end mouseUp

That works fine.

Something on the order of:

on mouseUp
  put first word of selectedtext of me into tshipID
  put "SELECT * FROM voyages WHERE shipID='" & \
      tshipID & "' LEFT JOIN vessels USING(shipID)" \
      into tSQLStatement
  put tSQLStatement
  revSetSQLOfQuery "Connect",tSQLStatement
end mouseUp


Which will lock the stack right up (it works fine without the LEFT JOIN). I
have Record set caching on but I don't understand how to get fields from
other tables in the database to show up as part of the same query.




More information about the use-livecode mailing list