Gustavo Comba  wrote:


>     I'm performing a simple query on my database and
>     I'm getting a "-7056 Subquery not allowed" for response. The query is:
>
> SELECT
>  "MONITOR"."PIEZAS"."IDPIEZA",
>  "MONITOR"."PIEZAS"."IDDISPOSITIVO",
>  "MONITOR"."PLATOS"."IDMODELO",
>  "MONITOR"."PIEZAS"."CODIGOPIEZA",
>  "MONITOR"."PIEZAS"."CODIGOLOTE",
>  "MONITOR"."PIEZAS"."FECHACREACION",
>  "MONITOR"."PIEZAS"."FECHACREACION" AS "FECHAMODIFICACION",
>             'Sistema' AS "USUARIO",
>             "MONITOR"."DISPOSITIVOS"."NOMBRE",
>             "MONITOR"."PLATOS"."PESO",
>             NUM("MONITOR"."PLATOS"."PESOOK") AS "PESOCORRECTO",
>  "MONITOR"."PLATOS"."DIAMETRO",
>  NUM("MONITOR"."PLATOS"."DIAMETROOK") AS "DIAMETROCORRECTO",
>  NUM("MONITOR"."PIEZAS"."FALLIDA") AS "PIEZAFALLIDA",
>  "MONITOR"."PIEZAS"."FECHACREACION" AS "ORDEN",
>             (SELECT COUNT(*) FROM PLATOS_ERRORES
>                 WHERE PLATOS_ERRORES.IDDISPOSITIVO = PLATOS.IDDISPOSITIVO
>                 AND PLATOS_ERRORES.IDPIEZA = PLATOS.IDPIEZA
>             ) AS FALLOS
> FROM "MONITOR"."PIEZAS","MONITOR"."PLATOS", "MONITOR"."DISPOSITIVOS"
> WHERE "MONITOR"."PIEZAS"."IDDISPOSITIVO"= "MONITOR"."PLATOS"."IDDISPOSITIVO"
> AND  "MONITOR"."PIEZAS"."IDPIEZA"= "MONITOR"."PLATOS"."IDPIEZA"
> AND "MONITOR"."PIEZAS"."IDDISPOSITIVO"= "MONITOR"."DISPOSITIVOS"."IDDISPOSITIVO"
> AND "MONITOR"."PLATOS"."IDMODELO" = 2

>     I've found the error's explanation on the documentation:
> -7056: Subquery not allowed
> Explanation:
> A <SUBQUERY> specification in a <CONSTRAINT DEFINITION> is not allowed.

>     But I think I'm not using the subquery on a "<CONSTRAINT DEFINITION>",
>     only on the "select" list... I think my query is normal.
 
 
Of which version are we talking about? 7.3.??? or 7.4beta or which kernel?
 
With 7.3 select in select-list are NOT possible,
with 7.4 they are. Your CORRELATED subquery is even a bit harder than normal
subqueries, but nevertheless, without knowledge of the kernel version, I cannot say
anything more.
 
Elke
SAP Labs
 
BTW:
- please do not use rich format, just plain text for your questions
- please tell use the version of the kernel / the clients you are using. There are differences
  even in the 7.3-livecycle, not to mention the differences (bug-fixes, features) with 7.4.
 

Reply via email to