I have a situation where, for the first time, I need to create about 100 SQL queries to extract various data items for a report. I've seen lots of apps that have dozens and dozens of TQuery-like components on them that each contain specific queries, and others that have long lists of string const definitions that contain the queries as strings that are loaded into a single, often dynamically created, TQuery-like component. These queries will never need to change unless some program requirement changes.

I have a situation where, for the first time, I need to create about 100 SQL queries to extract various data items for a report. I've seen lots of apps that have dozens and dozens of TQuery-like components on them that each contain specific queries, and others that have long lists of string const definitions that contain the queries as strings that are loaded into a single, often dynamically created, TQuery-like component. These queries will never need to change unless some program requirement changes.

Most of these queries will require a date range as parameters, but not many other parameters.

Aside from the obvious approach, where you'd create each query and test it in a SQL query manager tool of some sort, then paste it into a query component or put it in a static list that's stuffed into a TStringList or similar, are there any tools or approaches that make it easier to do this and get the queries back into the source code, or as form resources, or something along that line?

Comments

  1. Attila Kovacs I have some ideas on how to accomplish this if I need to roll my own solution. What I'm looking for here is whether anybody knows of any ready-made solutions. This doesn't seem like such an unusual requirement. (This app and another one here both have forms with 40-80 query components on them, and I've seen other apps with up to 200.)

    ReplyDelete

Post a Comment