Problem with Select
Posted in 2000
Topics: Connectivity: ESQL/C, 4GL & Embedded SQL, Platform-Specific Issues
Informix 4GL 7.2 and SQL 7.2 on RS6000 Aix 4.2.1
When I run the following select on a normal database it runs ok.
SELECT COUNT(*) FROM orderlev, avail, orderdetail
WHERE orderlev.prodnr = 002850
AND orderlev.fase > 30
AND orderlev.fase < 220
AND orderlev.extfase = 0
AND orderlev.retail = "N"
AND avail.intfase >= 50
AND avail.intfase < 530
AND avail.availnr = orderlev.availnr
AND orderdetail.orderdetnr = orderlev.orderdetnr
AND orderlev.klantpool in
( SELECT klantpool FROM klantaard, klantzonepool
WHERE klantaard.klantpool = orderlev.klantpool
AND klantaard.aardnr = orderdetail.aardnr
AND klantzonepool.zonenr = klantaard.zonenr
AND klantzonepool.annul = "N" )
For some reason I had to create on an other machine a database which
consists of only synonyms to the original database. When I execute the same
select on this database I get the following error :
352: Column (aardnr) not found.
Why do I get this error ?
Doris Willaert
doris.willaert@suzuki.be
That error, -352, indicates a problem creating an index. Looks like your
query is causing an autoindex creation which usually indicates that you
need to make a permanent index with that key. Run the query under
SET EXPLAIN to see the key of the auto index and make a permanentindex instead on the real server. That will solve the -352 problem.
Art S. Kagel
Willaert Doris wrote:
> Informix 4GL 7.2 and SQL 7.2 on RS6000 Aix 4.2.1
>
> When I run the following select on a normal database it runs ok.
>
> SELECT COUNT(*) FROM orderlev, avail, orderdetail
> WHERE orderlev.prodnr = 002850
> AND orderlev.fase > 30
> AND orderlev.fase < 220
> AND orderlev.extfase = 0
> AND orderlev.retail = "N"
> AND avail.intfase >= 50
> AND avail.intfase < 530
> AND avail.availnr = orderlev.availnr
> AND orderdetail.orderdetnr = orderlev.orderdetnr
> AND orderlev.klantpool in
> ( SELECT klantpool FROM klantaard, klantzonepool
> WHERE klantaard.klantpool = orderlev.klantpool
> AND klantaard.aardnr = orderdetail.aardnr
> AND klantzonepool.zonenr = klantaard.zonenr
> AND klantzonepool.annul = "N" )>
> For some reason I had to create on an other machine a database which
> consists of only synonyms to the original database. When I execute the same
> select on this database I get the following error :
>
> 352: Column (aardnr) not found.>
> Why do I get this error ?
>
> Doris Willaert
> doris.willaert@suzuki.be