Re: dynamic table/col names in plpgsql

Поиск
Список
Период
Сортировка
От Steve Atkins
Тема Re: dynamic table/col names in plpgsql
Дата
Msg-id 61204588-0B59-4A84-9302-80C03CE318A6@blighty.com
обсуждение исходный текст
Ответ на dynamic table/col names in plpgsql  ("gary jefferson" <garyjefferson123@gmail.com>)
Список pgsql-general
On Jun 23, 2007, at 8:47 PM, gary jefferson wrote:

> Is there a way to use a variable as the name of a table or column
> in plpgsql?
>
> This might be a simple question, but I can't find the answer in the
> docs.  http://www.postgresql.org/docs/8.2/interactive/plpgsql-
> declarations.html
> hints that there are data types that correspond to table/column, but I
> don't see them listed here
> http://www.postgresql.org/docs/8.2/interactive/datatype.html ...
>
> Also, I assume that once I figure out the right datatypes, I can
> assign to them from functions like substring()?

You're probably looking for "execute".

http://www.postgresql.org/docs/8.2/static/plpgsql-
statements.html#PLPGSQL-STATEMENTS-EXECUTING-DYN

Cheers,
   Steve


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

Предыдущее
От: Michael Glaesemann
Дата:
Сообщение: Re: dynamic table/col names in plpgsql
Следующее
От: "carter ck"
Дата:
Сообщение: Duplicate Key Violates Unique Contraint when Updating a table