Hello Erik,
What front end are you using? I primarily use PHP, and this procedure is
simple. You just use string operations to put together your query however
you want. Use variables, math, concactanation, or ... .
The question you need to ask is: I'm using ______ as a front end and "I want
to choose the destination table by a variable." "Is it possible?
"
Ray
----- Original Message -----
From: "Erik Dahlstrand" <df03daer@ing.hj.se>
To: <pgsql-novice@postgresql.org>
Sent: Friday, March 18, 2005 7:35 AM
Subject: [NOVICE] Destination table by variable?
Hi!
I want to choose the destination table by a variable. Something like this:
CREATE FUNCTION insert_this(int4, varchar, varchar) RETURNS void AS $$
DECLARE
destTable text;
BEGIN
SELECT INTO destTable get_table_name($1);
INSERT INTO destTable VALUES ($2, $3);
END;
$$ LANGUAGE plpgsql;
Is it possible?
/Erik
---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql.org so that your
message can get through to the mailing list cleanly
--
No virus found in this incoming message.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.7.3 - Release Date: 3/15/2005
--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.7.3 - Release Date: 3/15/2005