Recent

Author Topic: Can I re-use an SQLQuery?  (Read 1712 times)

AKCarlow

  • New Member
  • *
  • Posts: 45
Can I re-use an SQLQuery?
« on: July 11, 2014, 05:40:30 pm »
Using:
OS-X 10.6.8
Lazarus 1.2.4, FPC 2.6.4
MySQL 5.6.19 (32-bit)

On a form I have a TDBText, TDataSource and TSQLQuery. In a separate data module I have a TSQLTransaction and TMySQL56Connection. The SQL query in the TSQLQuery is 'select count(acolumn) from thetable;'. It works.

However, what I would like to do is move the value in the TDBTExt to a static field, then change the query to 'select count(zcolumn) from othertable;' but I can't see how to copy the count from the TDBTExt.

I could of course put another set of TDBText, TDataSource and TSQLQuery for the second query, but as there will in fact be several of them I would prefer not to clutter up the form, or the data module, with multiple occurences.

Thanks for any suggestions.
Using: OS-X 10.6.8, Lazarus 1.2.4, FPC 2.6.4,  MySQL 5.6.19 (32-bit)

AKCarlow

  • New Member
  • *
  • Posts: 45
Re: Can I re-use an SQLQuery?
« Reply #1 on: July 11, 2014, 05:58:47 pm »
 8-)
Ahh. I see it has a Caption property, not shown in the object inspector, which has the value I want.
Using: OS-X 10.6.8, Lazarus 1.2.4, FPC 2.6.4,  MySQL 5.6.19 (32-bit)

 

TinyPortal © 2005-2018