Hi,
 
    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.
 
    What's happening? Has somebody any clue?
 
        Thanks in advance,
 
                Gustavo Comba

Reply via email to