Functions - Mailing list pgsql-general

From Simon Drabble
Subject Functions
Date
Msg-id Pine.LNX.4.10.9911031459380.20207-100000@dragon.localdomain
Whole thread Raw
Responses Re: [GENERAL] Functions  (Andrew Perrin - Demography <aperrin@demog.berkeley.edu>)
Re: [GENERAL] Functions  ("Aaron J. Seigo" <aaron@gtv.ca>)
List pgsql-general
Ok, following on from the previous stuff, I'm now trying to put that update
into a function. How can I reference the passed parameter(s)?

  CREATE FUNCTION fn_fubar(int4) AS
  'UPDATE foo SET bar = tmp.numb FROM tmp WHERE tmp.numb = $$'
  LANGUAGSE 'sql';

where $$ would be the parameter passed to the function:

  SELECT fn_fubar(20);


Simon
Buying a SQL book this weekend :)



--
 "Linux - open doors, not windows."

   Simon Drabble                      It's like karma for your brain.
   simon@eskimo.com


pgsql-general by date:

Previous
From: "amy cheng"
Date:
Subject: Re: [GENERAL] query seems too slow
Next
From: "Timothy H. Keitt"
Date:
Subject: Re: [GENERAL] query seems too slow