Re: tablename as attribute in pgplsql
От | Stephan Szabo |
---|---|
Тема | Re: tablename as attribute in pgplsql |
Дата | |
Msg-id | 20030522184108.C51260-100000@megazone23.bigpanda.com обсуждение исходный текст |
Ответ на | tablename as attribute in pgplsql (Benoît Bournon <benoit.bournon@adelis.com>) |
Ответы |
Re: tablename as attribute in pgplsql
|
Список | pgsql-sql |
On Thu, 22 May 2003, [ISO-8859-1] Beno�t Bournon wrote: > DECLARE > usertablename ALIAS FOR $1 ; > userid ALIAS FOR $2 ; > > id_lang BIGINT ; > > var VARCHAR(200) ; > > BEGIN > var := 'client' ; > > SELECT id_language INTO id_lang FROM client WHERE id_user = userid ; > IF NOT (id_lang = 1 OR id_lang = 3) THEN > id_lang = 1 ; > END IF ; > > RETURN id_lang ; > > END ; > > I want to use client table as a variable > > How could I do Look at the documentation for EXECUTE. Unfortunately using EXECUTE into a variable is a little complicated right now AFAIR because you can't using select ... INTO variable inside the execute, but instead need to use something like for in execute loop.
В списке pgsql-sql по дате отправления: