tablename as attribute in pgplsql - Mailing list pgsql-sql

From Benoît Bournon
Subject tablename as attribute in pgplsql
Date
Msg-id 3ECCF0D1.8030705@adelis.com
Whole thread Raw
Responses Re: tablename as attribute in pgplsql  (Rod Taylor <rbt@rbt.ca>)
Re: tablename as attribute in pgplsql  (Stephan Szabo <sszabo@megazone23.bigpanda.com>)
List pgsql-sql
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



pgsql-sql by date:

Previous
From: "John Dwyer"
Date:
Subject: What do you think of this?
Next
From: Don Park
Date:
Subject: numeric fields and null