Skip site navigation (1) Skip section navigation (2)

Newbie help needed on Functions

From: "Jim Steil" <jim(dot)steil(at)customcall(dot)com>
To: <pgsql-novice(at)postgresql(dot)org>
Subject: Newbie help needed on Functions
Date: 2002-09-24 18:59:14
Message-ID: 002101c263fc$7e846730$6401a8c0@office (view raw, whole thread or download thread mbox)
Lists: pgsql-novice

I want to create a function that will return rows from a table based upon a parameter that I pass.

int ID,
varchar(50) NAME,
varchar(50) ADDRESS,
char(2) STATE

I would like my function to return the same result as it would if I entered the following SQL statement:

select ID, NAME, ADDRESS from NAMES where STATE = 'WI';

I want to pass 'WI' as a parameter.  I have looked through the programming guide but am confused by the return type and such.  Any help or pointers to further documentation would certainly be appreciated.


pgsql-novice by date

Next:From: Devinder K RajputDate: 2002-09-25 00:33:19
Subject: logging
Previous:From: Joachim SmitDate: 2002-09-24 12:57:59
Subject: Re: Disk space

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group