Re: function, that uses different table(names)

From: "A(dot) Kretschmer" <andreas(dot)kretschmer(at)schollglas(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: function, that uses different table(names)
Date: 2005-11-02 13:56:05
Message-ID: 20051102135605.GK12416@webserv.wug-glas.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

am 02.11.2005, um 14:36:06 +0100 mailte Moritz Bayer folgendes:
> live_table := ''tbl_highscore_app'' || cast($1 as varchar);
> SELECT i_return = max(userid) FROM ''tbl_highscore_app'' || cast($1 as
> varchar);
>
> My parser tells me that this is not possible.

Correct. You should build your string with the query and execute this
string.

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

Regards, Andreas
--
Andreas Kretschmer (Kontakt: siehe Header)
Heynitz: 035242/47212, D1: 0160/7141639
GnuPG-ID 0x3FFF606C http://wwwkeys.de.pgp.net
=== Schollglas Unternehmensgruppe ===

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Neil Saunders 2005-11-02 14:04:05 Re: PGSQL encryption functions
Previous Message A. Kretschmer 2005-11-02 13:38:52 Re: function, that uses different table(names)