Re: Issue with a variable in a function - Mailing list pgsql-sql

From David Johnston
Subject Re: Issue with a variable in a function
Date
Msg-id 006801cc9e3b$bb177ec0$31467c40$@yahoo.com
Whole thread Raw
In response to Issue with a variable in a function  (tlund79 <thomas.lund@eniro.no>)
Responses Re: Issue with a variable in a function  (tlund79 <thomas.lund@eniro.no>)
List pgsql-sql
-----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.




pgsql-sql by date:

Previous
From: Sylvain Mougenot
Date:
Subject: Re: Partitionning + Trigger and Execute not working as expected
Next
From: Russell Keane
Date:
Subject: Updatable view should truncate table fields