FW: Help- post gress sql error - Mailing list pgsql-sql

From Kota, Prasoona
Subject FW: Help- post gress sql error
Date
Msg-id 5F1655F5D5776C41AE28B981A3721E4607153B80@CWA0020EX.ccsouth.cccore.com
Whole thread Raw
Responses Re: FW: Help- post gress sql error  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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_idnot 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
fromtran_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.
====================================================


pgsql-sql by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: Function Syntax involving pipes and ' marks?
Next
From: Tom Lane
Date:
Subject: Re: FW: Help- post gress sql error