D1: Query's Expression too long??? 
Author Message
 D1: Query's Expression too long???


System Details: delphi 1, DBase IV tables, Windows 3.11, Novell Client, BDE

I am writing a program that has a query against a large table that adds up
the contents of certain fields (using SUM(field name)) from a table. The
records are selected by using a where clause that grows dynamically
depending on choices made by the user. I cycle through a list of items the
user may select from, and if they have been tagged, I add it to the query.
I know that each line in a TQuery can only be 255 chars and that it is made
up of a string list, so I add each entry to a new line so that I never
exceed the line length limit. The problem is that when the user selects
more than some certain number of items against the one field name, and I
create the query accordingly, the program crashes giving a very
uninformative error message saying that a GPF has occured in IDQRY01.DLL.
It works perfectly up until some certain number of items are queried
against the relevant field (not 255 characters, much less.)

I set the query to a memo box and copied the dynamically created query to
the Database Desktop and it does exactly the same.

Is there a limit to the number of contitions that one field can be
allocated in a SQL query in Delphi 1?

Is there a work around???

Examples of the two methods I have tried are as follows:

SELECT Period, SUM(NewClaims)
FROM Claims.dbf
 WHERE PolType = 'AAAA'
OR PolType = 'BBB'
OR PolType = 'QQQ'

or the statement:

SELECT Period, SUM(NewClaims)
FROM Claims.dbf
WHERE PolType IN ('AAAA', 'BBB', ... , PolType = 'QQQ')

Both cause the same error message in the IDQRY01.DLL after the number of
items tested against the one field reaches a certain size.


Andrew Aroney
**** Please remove the ! from my address if you are replying by email ****

Wed, 18 Jun 1902 08:00:00 GMT  
 [ 1 post ] 

 Relevant Pages 

1. D1 and Long File Names

2. Insert Query - Error in Expression

3. Using Quick Report's COUNT Expression component

4. Quickreport expressions don't calculate.

5. Too many open queries (D1 with Sybase)

6. D1 to D3 Query Problem

7. Query limitations (D1)?

8. D1: Query limits ??

9. D1 Heteregenous Queries IBase + IBase

10. Help with long strings as query parameters

11. Long SQL queries

12. Long queries


Powered by phpBB® Forum Software