Moritz Bayer <[EMAIL PROTECTED]> writes: > I've a bunch of tables, which have just about the same name. They are just > iterated like this:
> tbl_table1 > tbl_table2 > tbl_table3 > ... > They all have the same field, but different data. > Now I'm wondering, if I have to write functions for every table, although > they perform the same operation? > Or is it possible to pass an integer parameter to the function, use it to > put the right tablename together and perform the operation. As noted elsewhere, you could do that by building query strings and EXECUTE'ing them ... but you really ought to rethink your table layout, instead. The SQL-ish way to do this is to combine the tables into one big table with an extra key column that stores whatever condition distinguished the smaller tables in your mind. regards, tom lane ---------------------------(end of broadcast)--------------------------- TIP 1: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so that your message can get through to the mailing list cleanly