Board index » off-topic » "Could not find object" with union on BDE and using database STANDARD

"Could not find object" with union on BDE and using database STANDARD


2003-06-25 10:15:43 PM
off-topic14
I created a query that uses an union to combine two queries that
retrieve values from a table. There a six paramters in the query. When i
use those parameters the BDE returns an error with value in the subject.
But when the parameters are replaced with static values it all works.
This is the query i use:
------
select *
from breedval
where date in (select max(date)
from breedval
where id = :aid1
and kindofvalue = 2)
and id = :aid2
and kindofvalue = 2
and placenumber = :placenumber1
union
select *
from breedval
where date in (select max(date)
from breedval
where id = :aid3
and kindofvalue in (1,3))
and id = :aid4
and placenumber = :placenumber2
and kindofvalue in (1,3)
order by kindofvalue, fieldnumber
-----
This is the table structure:
placenumber integer
id integer
date date
kindofvalue integer
fieldnumber integer
fieldvalue float
I checked some pages on internet for this error, but there is only on
BDE installed on the system, there is only one version of the
isdapi32.dll and the aliasses are correct.
The query also works when only one part is used, in that situation i can
use the parameters and no error is raised. Any suggestion how to fix this?
--
Chris Wesdorp
V.S.M. Automatisering BV
 
 

Re:"Could not find object" with union on BDE and using database STANDARD

Probem fixed, i rebuild the query so that is doesn't use the union
statement. But i think its strange that the BDE returns this error.
Chris Wesdorp wrote:
Quote
I created a query that uses an union to combine two queries that
retrieve values from a table. There a six paramters in the query. When i
use those parameters the BDE returns an error with value in the subject.
But when the parameters are replaced with static values it all works.

This is the query i use:
------
select *
from breedval
where date in (select max(date)
from breedval
where id = :aid1
and kindofvalue = 2)
and id = :aid2
and kindofvalue = 2
and placenumber = :placenumber1

union

select *
from breedval
where date in (select max(date)
from breedval
where id = :aid3
and kindofvalue in (1,3))
and id = :aid4
and placenumber = :placenumber2
and kindofvalue in (1,3)
order by kindofvalue, fieldnumber
-----

This is the table structure:
placenumber integer
id integer
date date
kindofvalue integer
fieldnumber integer
fieldvalue float

I checked some pages on internet for this error, but there is only on
BDE installed on the system, there is only one version of the
isdapi32.dll and the aliasses are correct.

The query also works when only one part is used, in that situation i can
use the parameters and no error is raised. Any suggestion how to fix this?