Board index » delphi » Query of a query (with Local SQL)...?

Query of a query (with Local SQL)...?

Michael,

Hello again. Sorry, but subqueries aren't supported in the 16-bit
version of Delphi. However, the 32-bit version (to be released in the
first quarter of 96) will support full SQL 92.

Brendan

m...@panix.com (Michael Philip Kaufman) wrote:

Quote
>Does anyone know if there's a way -- with Paradox tables and the
>"Local SQL" engine -- to do a "query of a query"?
>Essentially, I have a table that's all strings, even though most of
>the columns *should* be numeric or time (time-ranges, numbers,
>etc.).  Normally, ANSI SQL would let me do various "calcs" in-line,
>so that I could select and/or sort by computed values.
>Apparently, this is not supported by Local SQL for Paradox tables.  
>The best I've done, so far, is to add "calculated fields" to the
>corresponding query component within Delphi (using an OnCalcFields
>handler).  Problem here is, these values are not computed until the
>SQL expression is already executed and rows are fetched...so I can't
>select or sort based on these calculated values.
>Other environments -- like Access, for instance -- would let me
>write a query of a query (i.e., "SELECT * FROM QueryName WHERE..."),
>but it's not immediately clear to me how that would work here.
>Worst case, I suppose I could *write* the results of an intermediate
>query back to disk (as a temp table), and then re-query that.  But
>there must be a better way...no?
>-------------------------------------------------------------------
>Michael Philip Kaufman                          Mail: m...@panix.com
>Software Design/Consulting                CompuServe: 71052,3715
>28 East 10th Street  Suite 4H                  Phone: 212 529 5592
>New York, NY  10003-6210                         Fax: 212 529 5001

"...an obsession with process will create a
      myopia that discourages people from testing
         assumtions and engaging in breakthrough thinking."
                                 -Patricia McLagan
 

Re:Query of a query (with Local SQL)...?


Does anyone know if there's a way -- with Paradox tables and the
"Local SQL" engine -- to do a "query of a query"?

Essentially, I have a table that's all strings, even though most of
the columns *should* be numeric or time (time-ranges, numbers,
etc.).  Normally, ANSI SQL would let me do various "calcs" in-line,
so that I could select and/or sort by computed values.

Apparently, this is not supported by Local SQL for Paradox tables.  
The best I've done, so far, is to add "calculated fields" to the
corresponding query component within Delphi (using an OnCalcFields
handler).  Problem here is, these values are not computed until the
SQL expression is already executed and rows are fetched...so I can't
select or sort based on these calculated values.

Other environments -- like Access, for instance -- would let me
write a query of a query (i.e., "SELECT * FROM QueryName WHERE..."),
but it's not immediately clear to me how that would work here.

Worst case, I suppose I could *write* the results of an intermediate
query back to disk (as a temp table), and then re-query that.  But
there must be a better way...no?

-------------------------------------------------------------------
Michael Philip Kaufman                          Mail: m...@panix.com
Software Design/Consulting                CompuServe: 71052,3715
28 East 10th Street  Suite 4H                  Phone: 212 529 5592
New York, NY  10003-6210                         Fax: 212 529 5001

Re:Query of a query (with Local SQL)...?


The closest you can come is using QBE.
Get the QBE component off of one of the Delphi pages.

Ryan Peterson
rpete...@usit.net

Other Threads