Re: tablename as attribute in pgplsql

From: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
To: Benoît Bournon <benoit(dot)bournon(at)adelis(dot)com>
Cc: <pgsql-sql(at)postgresql(dot)org>
Subject: Re: tablename as attribute in pgplsql
Date: 2003-05-25 16:07:17
Message-ID: 20030525090626.I35061-100000@megazone23.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql


On Fri, 23 May 2003, [ISO-8859-1] Benot Bournon wrote:

> It is not possible tu use a specific argument ? type table or tablename ?

Not for the table name in a direct statement like
select foo from variable;

> execute is not runnig

Define not running.

> Stephan Szabo a crit:
>
> >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.
> >
> >
> >
> >---------------------------(end of broadcast)---------------------------
> >TIP 5: Have you checked our extensive FAQ?
> >
> >http://www.postgresql.org/docs/faqs/FAQ.html
> >
> >
> >
>

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Markus Bertheau 2003-05-25 18:22:17 Re: select lower('ÆØÅ ABC'); does
Previous Message Markus Bertheau 2003-05-25 15:20:20 Re: pg_connect