Re: help with dynamic table name

Поиск
Список
Период
Сортировка
Искать
От
Peter Schonefeld
Тема
Re: help with dynamic table name
Дата
Msg-id
9cc0d1180703052112o26fc8c2bs18a1b02a68dd5ec1@mail.gmail.com
Ответ на
Re: help with dynamic table name (Jasbinder Singh Bali)
Список
Дерево обсуждения
help with dynamic table name "Peter Schonefeld" <peter.schonefeld@gmail.com>
Re: help with dynamic table name "Jasbinder Singh Bali" <jsbali@gmail.com>
Re: help with dynamic table name Tom Lane <tgl@sss.pgh.pa.us>
Re: help with dynamic table name Michael Fuhr <mike@fuhr.org>
Re: help with dynamic table name "Jasbinder Singh Bali" <jsbali@gmail.com>
Re: help with dynamic table name "Peter Schonefeld" <peter.schonefeld@gmail.com>
Re: help with dynamic table name Stephan Szabo <sszabo@megazone.bigpanda.com>
Re: help with dynamic table name "Peter Schonefeld" <peter.schonefeld@gmail.com>
Re: help with dynamic table name "Jasbinder Singh Bali" <jsbali@gmail.com>
Re: help with dynamic table name "Jasbinder Singh Bali" <jsbali@gmail.com>
Re: help with dynamic table name "Peter Schonefeld" <peter.schonefeld@gmail.com>
Re: help with dynamic table name Tom Lane <tgl@sss.pgh.pa.us>
Re: help with dynamic table name "Jasbinder Singh Bali" <jsbali@gmail.com>
Still no joy...if i forget about the variables and just try buidling a string to execute, eg:

sql := 'INSERT INTO application (id,body) VALUES (''asdf'',''lkjh'')';
 
It works.

but with the variables i still get an error...

I tried putting quotes (two single quote chars) around the VALUES variables

  sql := 'INSERT INTO '+ $3 +' (id,body) VALUES ('''+ $1 +''','''+ $2 +''')';

but it still will not work. "ERROR: 42883: operator does not exist: \"unknown\" + character varying"

Pete


On 3/6/07, Jasbinder Singh Bali < jsbali@gmail.com> wrote:
 
sql := 'INSERT INTO '+ $3 +' (id,body) VALUES ('+ $1 +','+ $2 +')';
remove the double quotes with id and body and see if it works.
~Jas

В списке pgsql-novice по дате отправления
От: Peter Schonefeld
Дата:
От: Jasbinder Singh Bali
Дата:
FAQ