Обсуждение: Unable to run this query

Поиск
Список
Период
Сортировка

Unable to run this query

От
Srikanth Kata
Дата:
I am not able to run this query in Postgres 8.4 and the OS is Linux Centos 5.

I have dump of the DB, but in clients place this query is taking lots of
time but no errors.

Please suggest me what is the case to rectify this error.

select
s.*,a.actid,a.phone,d.domid,d.domname,d.domno,a.actno,a.actname,p.descr
as svcdescr from vwsubsmin s
inner join packages p on s.svcno=p.pkgno
inner join account a on a.actno=s.actno
inner join ssgdom d on a.domno=d.domno
inner join (select subsno from getexpiringsubs($1,cast($2 as
integer),cast($3 as double precision), $4) as
(subsno int,expirydt timestamp without time zone,balcpt double precision))
as e on s.subsno=e.subsno
where s.status<=15 and d.domno=$5
order by d.domname,s.expirydt,a.actname

It is showing the error as ERROR:  THERE IS NO PARAMETER $1
LINE 1: ...no inner join (select subsno from getexpiringsubs($1,cast($2..
--
View this message in context: http://old.nabble.com/Unable-to-run-this-query-tp29073430p29073430.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.


Re: Unable to run this query

От
Pavel Stehule
Дата:
2010/7/5 Srikanth Kata <srikanth@inventum.net>:
>
> I am not able to run this query in Postgres 8.4 and the OS is Linux Centos 5.
>
> I have dump of the DB, but in clients place this query is taking lots of
> time but no errors.
>
> Please suggest me what is the case to rectify this error.
>
> select
> s.*,a.actid,a.phone,d.domid,d.domname,d.domno,a.actno,a.actname,p.descr
> as svcdescr from vwsubsmin s
> inner join packages p on s.svcno=p.pkgno
> inner join account a on a.actno=s.actno
> inner join ssgdom d on a.domno=d.domno
> inner join (select subsno from getexpiringsubs($1,cast($2 as
> integer),cast($3 as double precision), $4) as
> (subsno int,expirydt timestamp without time zone,balcpt double precision))
> as e on s.subsno=e.subsno
> where s.status<=15 and d.domno=$5
> order by d.domname,s.expirydt,a.actname
>
> It is showing the error as ERROR:  THERE IS NO PARAMETER $1
> LINE 1: ...no inner join (select subsno from getexpiringsubs($1,cast($2..

probably use a wrong API. Your query uses parameters - $1, $2, ... but
you are not define these parameters in your code.

Regards
Pavel Stehule

> --
> View this message in context: http://old.nabble.com/Unable-to-run-this-query-tp29073430p29073430.html
> Sent from the PostgreSQL - general mailing list archive at Nabble.com.
>
>
> --
> Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general
>