Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 1358E195CEEC for ; Tue, 8 Nov 2011 13:27:55 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 27942-10 for ; Tue, 8 Nov 2011 17:27:49 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0-rc2 Received: from smtp108.prem.mail.sp1.yahoo.com (smtp108.prem.mail.sp1.yahoo.com [98.136.44.63]) by mail.postgresql.org (Postfix) with SMTP id ED7B0195CEEB for ; Tue, 8 Nov 2011 13:27:48 -0400 (AST) Received: (qmail 67152 invoked from network); 8 Nov 2011 17:27:47 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=DKIM-Signature:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:Received:From:To:References:In-Reply-To:Subject:Date:Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding:X-Mailer:Thread-Index:Content-Language; b=Oyyn2nx4vi1yXdlDDTFl0lTmV56hwbfWaVILcYcY1WpVLBWEBqcqLVDiRRDQEJLWmFQi/6b37Ehq4qC9hj+qxIxwqwmM4WA+FRJYJ6e3C7/23SgHa2ZRRtGGBlLgomMXBuHC1s4O5Zbte5ceaUA5H6gVGHJmlka0yFcoVwm5dq8= ; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1320773267; bh=iJyTnW5E2BxDIQvOMi1ZatyTVdQB3ZTNPuBGyvlnVmQ=; h=X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:Received:From:To:References:In-Reply-To:Subject:Date:Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding:X-Mailer:Thread-Index:Content-Language; b=iouCK3JmNlrszeuGiWOewRbsIYKu5tQv59cJ6Vuh8yhH8DvRGDG6X7biIkxB5ikmHJCRrUZOtkUGf2jk9bvOT8z9gCR73PLLVvHRRibOJ/9vdlCcI1SEfzIjKGMcbEugE/9dH8+AdFEYLr/1GT22seJyWOBJKXy6S0qneGWxW1k= X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: L_9p8SoVM1m1MAo66LlBzYekSE0vQkb3ACjy35q19mSQpET 50i0MDnX21o.QxxTY1BWIYkVF8qo7MxuX.XFAqtWU6zdHH8CZPIp91NME5nP 6unAO8nFFq7v3ScCANSuawlX2FkcMy2tSCsyJHmHv4lBy3lyBsm3OE1W8uO8 7SIxZN3D7kqRO9yCjJzTt5Z3ztv4TD7SPzEB8q.Q1xQ.siAmt0ELAgd2ip6N pV5l41KsHWE7K2ndQOezrGRWE2djSYmm7fBCKvM4Jcz4cK7D1MaO4ebap2_1 qplviIeXNNdj6w8bRhWThdyQ334YM4p4nMvZsd6THgour7UlxzSGTuocs..g QTK9CmfNxcLitHoVI4nJabrAa0026ZhPa5AxG3kdMYdzsxsRl7pXRkPVLwI5 s0aH8cw-- X-Yahoo-SMTP: mpGJl6eswBD2IBufoVEg0Pa8gg-- Received: from WolfDog (polobo@24.93.23.188 with login) by smtp108.prem.mail.sp1.yahoo.com with SMTP; 08 Nov 2011 09:27:47 -0800 PST From: "David Johnston" To: "'tlund79'" , References: <1320758213629-4974235.post@n5.nabble.com> In-Reply-To: <1320758213629-4974235.post@n5.nabble.com> Subject: Re: Issue with a variable in a function Date: Tue, 8 Nov 2011 12:27:45 -0500 Message-ID: <006801cc9e3b$bb177ec0$31467c40$@yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Outlook 14.0 Thread-Index: AQIc7Y08LCnApvXrT9LS7gCo2efv+JUCmFiQ Content-Language: en-us X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-3.099 tagged_above=-5 required=5 tests=BAYES_00=-1.9, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RP_MATCHES_RCVD=-1.201, UNPARSEABLE_RELAY=0.001 X-Spam-Level: X-Archive-Number: 201111/37 X-Sequence-Number: 36010 -----Original Message----- From: pgsql-sql-owner@postgresql.org [mailto:pgsql-sql-owner@postgresql.org] On Behalf Of tlund79 Sent: Tuesday, November 08, 2011 8:17 AM To: pgsql-sql@postgresql.org Subject: [SQL] Issue with a variable in a function The issue relates to the variable "prosjektkode" ($4). CREATE OR REPLACE FUNCTION ppr_data(aarstall int, frauke int, tiluke int, prosjektkode int) RETURNS int AS $$ DECLARE antall bigint; -----------/Original Message---------- Read about "ARRAY"s Change your function signature to something like: CREATE OR REPLACE FUNCTION ppr_data(aarstall int, frauke int, tiluke int, prosjektkode int[] ) -- Note the change to int[] from int for prosjektkode David J.