Обсуждение: Questions for experts

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

Questions for experts

От
SEB Menard
Дата:
I want to perform dynamic SQL update in PL/PGSQL... i don't know the
name of the columns that i want to update. i just want to update a
complete line... How i can get the names of the columns of a table in
PL/PGSQL for produce a dynamic  SQL update? 

In Oracle UPDATE ...SET ROW do the jobs any substitutes in POSTGRES?


Thanks a lot!!!!  



Re: Questions for experts

От
Richard Huxton
Дата:
On Tuesday 13 May 2003 1:15 pm, SEB Menard wrote:
> I want to perform dynamic SQL update in PL/PGSQL... i don't know the
> name of the columns that i want to update. i just want to update a
> complete line... How i can get the names of the columns of a table in
> PL/PGSQL for produce a dynamic  SQL update?
>
> In Oracle UPDATE ...SET ROW do the jobs any substitutes in POSTGRES?

Start psql with the -E flag, then \d etc will show you the queries they run to
provide their output. There's also a system catalogue section in the manuals

--  Richard Huxton


Re: Questions for experts

От
Tom Lane
Дата:
SEB Menard <smenard@avior.ca> writes:
> I want to perform dynamic SQL update in PL/PGSQL... i don't know the
> name of the columns that i want to update. i just want to update a
> complete line... How i can get the names of the columns of a table in
> PL/PGSQL for produce a dynamic  SQL update? 

Use pltcl, not plpgsql.  This sort of thing is easy in pltcl, hard or
impossible in plpgsql.
        regards, tom lane