Re: ERROR: there is no parameter $1

Поиск
Список
Период
Сортировка
От Sergey Konoplev
Тема Re: ERROR: there is no parameter $1
Дата
Msg-id CAL_0b1sQg9Mx59Mw9CC6i1=OEmX7Mh4VUe_M4Ak1hkAgNp+1QA@mail.gmail.com
обсуждение исходный текст
Ответ на ERROR: there is no parameter $1  ("Madhu.Lanka" <mlanka@avineonindia.com>)
Ответы Re: ERROR: there is no parameter $1  ("Martin French" <Martin.French@romaxtech.com>)
Список pgsql-admin
On Fri, Jul 20, 2012 at 6:33 AM, Madhu.Lanka <mlanka@avineonindia.com> wrote:
> I am getting the following error
>
> ERROR:  there is no parameter $1
> LINE 5: r.role_id = u.role_id and p.name= $1 and p.password = $2

Because they are not expanding inside strings. Use EXECUTE ... USING ...

EXECUTE '... and p.name =$1  and p.password = $2;' USING pname, ppassword

--
Sergey Konoplev

a database architect, software developer at PostgreSQL-Consulting.com
http://www.postgresql-consulting.com

Jabber: gray.ru@gmail.com Skype: gray-hemp Phone: +79160686204

В списке pgsql-admin по дате отправления:

Предыдущее
От: David Kerr
Дата:
Сообщение: Re: Measurin the lag between a master and a replica
Следующее
От: Craig Ringer
Дата:
Сообщение: Re: Postgres Database got down