Hi,
 
I have never seen a subquery in a result column spec, so it is probably not allowed here.
What do you want to get here? Would you like to have the same result of the subquery in every row of your result set? Or do you need something like a correlated subquery that selects something depending on some column value of the actual row of the main query?
 
Florian Kaerner
-----Urspr�ngliche Nachricht-----
Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]Im Auftrag von Gustavo Comba
Gesendet: Montag, 25. November 2002 16:10
An: [EMAIL PROTECTED]
Betreff: Subquery not allowed

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