Re: help with dynamic table name

Поиск
Список
Период
Сортировка
От Stephan Szabo
Тема Re: help with dynamic table name
Дата
Msg-id 20070305205900.W82091@megazone.bigpanda.com
обсуждение исходный текст
Ответ на Re: help with dynamic table name  ("Peter Schonefeld" <peter.schonefeld@gmail.com>)
Ответы Re: help with dynamic table name  ("Peter Schonefeld" <peter.schonefeld@gmail.com>)
Список pgsql-novice
On Tue, 6 Mar 2007, Peter Schonefeld wrote:

> Hi Jas, thanks for the quick reply...I had started out with the single
> quotes, but had chaged it in my many efforts to get the thing to work...with
> the single quotes i'm getting the error:
>
> "ERROR: 42883: operator does not exist: \"unknown\" + character varying"
>
> ====
>
> CREATE OR REPLACE FUNCTION sc_insert_row(char(32),text,varchar(32)) RETURNS
> text AS $$
>
> DECLARE sql text;
> BEGIN
>   sql := 'INSERT INTO '+ $3 +' ("id","body") VALUES ('+ $1 +','+ $2 +')';

In addition to the conversion to single quotes, you probably mean to be
using || (string concatenation) rather than + (addition) in the above.

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

Предыдущее
От: "Jasbinder Singh Bali"
Дата:
Сообщение: Re: help with dynamic table name
Следующее
От: "Peter Schonefeld"
Дата:
Сообщение: Re: help with dynamic table name