Wednesday, September 10, 2008

[SQL] FW: Help- post gress sql error

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.
====================================================

--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql

No comments: