Re: Issue with a variable in a function

From: "David Johnston" <polobo(at)yahoo(dot)com>
To: "'tlund79'" <thomas(dot)lund(at)eniro(dot)no>, <pgsql-sql(at)postgresql(dot)org>
Subject: Re: Issue with a variable in a function
Date: 2011-11-08 17:27:45
Message-ID: 006801cc9e3b$bb177ec0$31467c40$@yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

-----Original Message-----
From: pgsql-sql-owner(at)postgresql(dot)org [mailto:pgsql-sql-owner(at)postgresql(dot)org]
On Behalf Of tlund79
Sent: Tuesday, November 08, 2011 8:17 AM
To: pgsql-sql(at)postgresql(dot)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.

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Russell Keane 2011-11-08 21:34:08 Updatable view should truncate table fields
Previous Message Sylvain Mougenot 2011-11-08 16:04:39 Re: Partitionning + Trigger and Execute not working as expected