Re: [SQL] function, that uses different table(names)

2005-11-02 Thread Moritz Bayer
Thanks, great thing! Since I have an select statement, I'll have to use a cursor. Just as execute I haven't used it before. So I can say that I've learned something today :) Thaks again, Moritz

Re: [SQL] function, that uses different table(names)

2005-11-02 Thread Moritz Bayer
Sorry, pushed the send - button  by accident. So here is the right text: CREATE OR REPLACE function getmaxuserid(integer) RETURNS integer AS' DECLARE live_table varchar(100);   DECLARE i_return integer; BEGIN live_table := ''tbl_highscore_app'' || cast($1 as varchar); SELECT

[SQL] function, that uses different table(names)

2005-11-02 Thread Moritz Bayer
Hello group, 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 ope

[SQL] Please help, can't figure out what's wrong with this function...

2005-09-12 Thread Moritz Bayer
Hello group,   I 've written the following function:   CREATE OR REPLACE FUNCTION "public"."getstadtlandflussentrybyid" (integer) RETURNS SETOF "public"."ty_stadtlandflussentry" AS'DECLARE objReturn ty_stadtlandflussentry; DECLARE iid  integer;BEGIN    iid := $1;    for objReturn IN   

Re: [SQL] Problem with self-made plpgsql-function / casting

2005-08-20 Thread Moritz Bayer
That's it!!! Thanks a lot!   Moritz   PS: Hope some day I'll be the one to be an help for newbies! I'm working on it!   2005/8/20, Tom Lane <[EMAIL PROTECTED]>: Moritz Bayer <[EMAIL PROTECTED]> writes: >  ERROR: function public.fc_editlanguage(integer, "unkn

Re: [SQL] Problem with self-made plpgsql-function / casting

2005-08-20 Thread Moritz Bayer
name'::varchar, 'some textvalue'::varchar, 456)Best of luck,Mark On Sat, 2005-08-20 at 16:54 +0200, Moritz Bayer wrote:> Hello,>> I'm a newbie to postgres and trying to produce my first functions.> Everything works fine as long as it takes numeric parameters, but whe

[SQL] Problem with self-made plpgsql-function / casting

2005-08-20 Thread Moritz Bayer
Hello,   I'm a newbie to postgres and trying to produce my first functions. Everything works fine as long as it takes numeric parameters, but when I'm trying to use varchar or text-parameters, it fails and throws the following exception:   ERROR:  function public.fc_editlanguage(integer, "unknown"