Problem with Subquery - Mailing list pgsql-general

From Marc Polatschek
Subject Problem with Subquery
Date
Msg-id 2266D0630E43BB4290742247C89105752B2337@dozer.computec.de
Whole thread Raw
Responses Re: Problem with Subquery  (Joel Burton <joel@joelburton.com>)
Re: Problem with Subquery  (Stephan Szabo <sszabo@megazone23.bigpanda.com>)
Re: Problem with Subquery  (Darren Ferguson <darren@crystalballinc.com>)
List pgsql-general
We recently changed our database system from Oracle 8i to postgreSQL. Im
right now changing our cold fusion code and i have get this problem:

    select    ID,
            NAME,
            WEBSITE_URL,
            (
            select    count(*)
            from        MAIN_PC_GAME,
                    MAIN_COMPANY
            where        DEVELOPER_ID = MAIN_COMPANY.ID
            or        PUBLISHER_ID = MAIN_COMPANY.ID
            ) as TOTAL
    from        MAIN_COMPANY
    where        (
                     lower(SOFTWARE_DEVELOPER)='yes'
            or         lower(SOFTWARE_PUBLISHER)='yes'
            )

This SQL statement isnt working with postgreSQL but it worked without
any problems in Oracle. Postgres Error Message:

    Unable to identify an operator '=' for types 'character varying'
and 'numeric'
    You will have to retype this query using an explicit cast

I think postgreSQL cant handle the variable MAIN_COMPANY.ID from the
parent Scope. Probably there is a way to mark this variable to find it
in the caller.scope. But i dont know how.

      Marc Polatschek
        Head of Development
        COMPUTEC MEDIA AG
        Dr.-Mack-Straße 77
        D-90762 Fürth
        phone: +49 (0) 911 2872 - 106
        fax: +49 (0) 911 2872 - 200
        mail: marc.polatschek@computec.de


pgsql-general by date:

Previous
From: Masse Jacques
Date:
Subject: Re: Question to CREATE FUNCTION
Next
From: Bruce Momjian
Date:
Subject: Re: Temp Tables