Board index » delphi » Hey BORLAND - BDE Query errors...WHY?

Hey BORLAND - BDE Query errors...WHY?

I am running a query against dBase tables. Whenever I use the MAX or
MIN function the record structure gets modified somehow.

e.g.  Select Name, Start_Dt, MAX(Stop_Dt) as Stop_Dt, Title, Position
FROM Projects

This query returns a dataset that gets saved (via the api call
dbiMakePermanent) For some reason the delete byte of these records
gets set to NULL and this screws up EVERY subsequent query that uses
this saved dataset.   <saved as MyTestSet.dbf>

There are 5 records in this result set that are the same. If I run the
SQL statement
    SELECT DISTINCT * FROM MyTestSet

I get ALL records returned ... even though there are 5 records the
same!

I have looked at the same data without using MAX (basically just
SELECT *) and saving it as a file (using dbiMakePermanent) and this
problem (the null delete byte) does not happen.

Why is this occuring? How can I fix this?  This is creating MAJOR
problems with our reporting system...

Bill Artemik
Programmer / Analyst
b...@droste1.com

"The number one CAUSE of computer problems
     is computer SOLUTIONS."

 

Re:Hey BORLAND - BDE Query errors...WHY?


Hello,

MAX, MIN etc. are agregate functions you can use ONLY one of them in SELECT
statement expression

SELECT MAX(Stop_Dt)
FROM Project
[WHERE restrict condition]

Danail Iliev

Quote
"Bill Artemik" <b...@droste1.com> wrote in message

news:3a6464fc.494655577@newsgroups.borland.com...
Quote
> I am running a query against dBase tables. Whenever I use the MAX or
> MIN function the record structure gets modified somehow.

> e.g.  Select Name, Start_Dt, MAX(Stop_Dt) as Stop_Dt, Title, Position
> FROM Projects

> This query returns a dataset that gets saved (via the api call
> dbiMakePermanent) For some reason the delete byte of these records
> gets set to NULL and this screws up EVERY subsequent query that uses
> this saved dataset.   <saved as MyTestSet.dbf>

> There are 5 records in this result set that are the same. If I run the
> SQL statement
>     SELECT DISTINCT * FROM MyTestSet

> I get ALL records returned ... even though there are 5 records the
> same!

> I have looked at the same data without using MAX (basically just
> SELECT *) and saving it as a file (using dbiMakePermanent) and this
> problem (the null delete byte) does not happen.

> Why is this occuring? How can I fix this?  This is creating MAJOR
> problems with our reporting system...

> Bill Artemik
> Programmer / Analyst
> b...@droste1.com

> "The number one CAUSE of computer problems
>      is computer SOLUTIONS."

Re:Hey BORLAND - BDE Query errors...WHY?


Are you using BDE 5.1.1?

Quote
"Bill Artemik" <b...@droste1.com> wrote in message

news:3a6464fc.494655577@newsgroups.borland.com...
Quote
> I am running a query against dBase tables. Whenever I use the MAX or
> MIN function the record structure gets modified somehow.

> e.g.  Select Name, Start_Dt, MAX(Stop_Dt) as Stop_Dt, Title, Position
> FROM Projects

> This query returns a dataset that gets saved (via the api call
> dbiMakePermanent) For some reason the delete byte of these records
> gets set to NULL and this screws up EVERY subsequent query that uses
> this saved dataset.   <saved as MyTestSet.dbf>

> There are 5 records in this result set that are the same. If I run the
> SQL statement
>     SELECT DISTINCT * FROM MyTestSet

> I get ALL records returned ... even though there are 5 records the
> same!

> I have looked at the same data without using MAX (basically just
> SELECT *) and saving it as a file (using dbiMakePermanent) and this
> problem (the null delete byte) does not happen.

> Why is this occuring? How can I fix this?  This is creating MAJOR
> problems with our reporting system...

> Bill Artemik
> Programmer / Analyst
> b...@droste1.com

> "The number one CAUSE of computer problems
>      is computer SOLUTIONS."

Re:Hey BORLAND - BDE Query errors...WHY?


Yes.

Quote
>Are you using BDE 5.1.1?

>"Bill Artemik" <b...@droste1.com> wrote in message
>news:3a6464fc.494655577@newsgroups.borland.com...
>> I am running a query against dBase tables. Whenever I use the MAX or
>> MIN function the record structure gets modified somehow.

>> e.g.  Select Name, Start_Dt, MAX(Stop_Dt) as Stop_Dt, Title, Position
>> FROM Projects

>> This query returns a dataset that gets saved (via the api call
>> dbiMakePermanent) For some reason the delete byte of these records
>> gets set to NULL and this screws up EVERY subsequent query that uses
>> this saved dataset.   <saved as MyTestSet.dbf>

>> There are 5 records in this result set that are the same. If I run the
>> SQL statement
>>     SELECT DISTINCT * FROM MyTestSet

>> I get ALL records returned ... even though there are 5 records the
>> same!

>> I have looked at the same data without using MAX (basically just
>> SELECT *) and saving it as a file (using dbiMakePermanent) and this
>> problem (the null delete byte) does not happen.

>> Why is this occuring? How can I fix this?  This is creating MAJOR
>> problems with our reporting system...

>> Bill Artemik
>> Programmer / Analyst
>> b...@droste1.com

>> "The number one CAUSE of computer problems
>>      is computer SOLUTIONS."

Bill Artemik
Programmer / Analyst
b...@droste1.com

"The number one CAUSE of computer problems
     is computer SOLUTIONS."

Other Threads