Skip site navigation (1) Skip section navigation (2)

FW: Help- post gress sql error

From: "Kota, Prasoona" <Prasoona(dot)Kota(at)CompuCredit(dot)com>
To: <pgsql-sql(at)postgresql(dot)org>
Subject: FW: Help- post gress sql error
Date: 2008-09-10 13:57:50
Message-ID: 5F1655F5D5776C41AE28B981A3721E4607153B80@CWA0020EX.ccsouth.cccore.com (view raw or flat)
Thread:
Lists: pgsql-sql
Hi!

I am receiving the following error when trying to execute sql

--------------------
Error: ERROR:  ExecSubPlan: failed to find placeholder for subplan
result  (State:HY000, Native Code: 2C)
---------------------

My query works fine in Oracle database without any issues. 

I have sub queries with in the sql. If I replace sub queries with hard
coded values query works fine.
---------------------
select ft.a_id
    ,sum(nvl(ft.t_amt,0)) fee
from a_tran ft
    ,c_sum c1
    ,(  select c.a_id,max(c.c_end_date)as end_date
        from c_sum c
        where c.d_status_id not in (7,10)
        and c.c_end_date between '01-jun-2008' and '31-jul-2008'
        group by c.a_id) prev
where ft.a_id=prev.a_id
and c1.a_id=prev.a_id
and c1.c_end_date=prev.end_date
and ft.p_date between '01-jul-2008' and '31-jul-2008'
and (( ft.t_code in ( select fld1_source_value from tran_code)
      )
      OR ( ft.t_code in ( select fld1_source_value from tran_code_2)
          and ft.t_description not in (
                     select tran_dscr from tran_code_dscr)
         )
     )
and ft.p_date between c1.c_start_date and c1.c_end_date group by
ft.a_id;
----------

Please advice if there is any setting that can be made to avoid this
problem.

Thanks,
Prasoona

-----------------------------------------
====================================================
This message contains PRIVILEGED and CONFIDENTIAL
information that is intended only for use by the 
named recipient. If you are not the named recipient,
any disclosure, dissemination, or action based on 
the contents of this message is prohibited. In such
case please notify us and destroy and delete all 
copies of this transmission.  Thank you.
====================================================

Responses

pgsql-sql by date

Next:From: Tom LaneDate: 2008-09-10 16:04:21
Subject: Re: FW: Help- post gress sql error
Previous:From: Alvaro HerreraDate: 2008-09-10 00:58:48
Subject: Re: Function Syntax involving pipes and ' marks?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group