Received: from localhost (unknown [200.46.204.184]) by developer.postgresql.org (Postfix) with ESMTP id 4C1902E0046 for ; Tue, 22 Apr 2008 06:54:22 -0300 (ADT) Received: from developer.postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 41767-06 for ; Tue, 22 Apr 2008 06:54:04 -0300 (ADT) X-Greylist: delayed 00:06:38.920691 by SQLgrey-1.7.5 Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by developer.postgresql.org (Postfix) with SMTP id 73CC42E0044 for ; Tue, 22 Apr 2008 06:54:09 -0300 (ADT) Received: (qmail 8188 invoked by uid 0); 22 Apr 2008 09:47:27 -0000 Received: from 62.218.164.126 by www145.gmx.net with HTTP; Tue, 22 Apr 2008 11:47:27 +0200 (CEST) Content-Type: text/plain; charset="us-ascii" Date: Tue, 22 Apr 2008 11:47:27 +0200 From: "Jan Peters" Message-ID: <20080422094727.271410@gmx.net> MIME-Version: 1.0 Subject: Problems with function while migrating from Windows to Linux To: pgsql-sql@postgresql.org X-Authenticated: #16900582 X-Flags: 0001 X-Mailer: WWW-Mail 6100 (Global Message Exchange) X-Priority: 3 X-Provags-ID: V01U2FsdGVkX1/6d25hGhH6I9ccqGG7YbAg8B/78C1vWOnkqjFsRu DNSDvnkFGDu7fNCR2wQQUR36oEfp8JrzczUA== Content-Transfer-Encoding: 7bit X-GMX-UID: HY0+cDBeMmA6Ro2NamBna3Y5MjQ1N90K X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200804/127 X-Sequence-Number: 30666 Hello list, after developping my application in a Windows environment I am now migrating to the production Linux webserver. I backed up my database, functions and schemas and imported them again via pgAdmin III, because the first application which I used to do the transfer did not move the variable aliases within the function. So what I have (what is running under Windows) is: function: getgv_neu(id int4, tablename text, runde1 int4, runde2 int4) returns int4: --------------------8<---------------------------- DECLARE tablename1 varchar := quote_ident(tablename); result_aktiva integer; result_passiva integer; sum integer; BEGIN EXECUTE 'SELECT getaktiva(' || id|| ',' || runde1 || ',' || runde2 || ') ;' INTO result_aktiva; if result_aktiva < -100000 THEN RETURN result_aktiva; END IF; EXECUTE 'SELECT getpassiva(\'' || tablename1 || '\',' || id || ');' INTO result_passiva; sum = result_aktiva - result_passiva; RETURN sum; END; --------------------8<---------------------------- when I do e.g. a "select getgv_neu(5,'company_5',1,0)" I get the error message: ERROR: syntax error at or near "$4" at character 81 QUERY: SELECT 'SELECT getaktiva(' || $1 || ',' || $2 || ',' || $3 || ') ;' INTO $4 CONTEXT: PL/pgSQL function "getgv_neu" line 7 at execute statement What might be the problem here? Any ideas? I am stuck... Thanks again in advance Jan Peters-Anders -- GMX startet ShortView.de. Hier findest Du Leute mit Deinen Interessen! Jetzt dabei sein: http://www.shortview.de/?mc=sv_ext_mf@gmx