Received: from localhost (maia-5.hub.org [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id 5EBFD9FB52F for ; Fri, 20 Apr 2007 11:13:33 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-maia, port 10024) with ESMTP id 92729-10 for ; Fri, 20 Apr 2007 11:13:16 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from mail100.cra-arc.gc.ca (mail100.cra-arc.gc.ca [198.103.184.20]) by postgresql.org (Postfix) with ESMTP id 8FE8B9FB254 for ; Fri, 20 Apr 2007 11:13:22 -0300 (ADT) Received: from SD07ITMB01.PROD.NET (unknown [7.32.21.166]) by mail100.cra-arc.gc.ca (mail) with ESMTP id 0C4CCDE32M for ; Fri, 20 Apr 2007 10:13:21 -0400 (EDT) Received: from SD01ITMV12.PROD.NET ([7.32.10.12]) by SD07ITMB01.PROD.NET with Microsoft SMTPSVC(6.0.3790.2499); Fri, 20 Apr 2007 10:13:21 -0400 x-mimeole: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01C78356.0CDCC83F" Subject: Function to return a multiple colmn table or view Date: Fri, 20 Apr 2007 10:13:20 -0400 Message-ID: <7CCC5BEF5E72394C963E529B54EB4A642A19F1@SD01ITMV12.PROD.NET> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Function to return a multiple colmn table or view Thread-Index: AceDVgy6gQUpmX5zTpuU03heSlt7Nw== From: "Wilkinson, Jim" To: X-OriginalArrivalTime: 20 Apr 2007 14:13:21.0076 (UTC) FILETIME=[0CEEEF40:01C78356] X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200704/185 X-Sequence-Number: 28185 This is a multi-part message in MIME format. ------_=_NextPart_001_01C78356.0CDCC83F Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable I am new to psql , so please be patient ! Can someone please provide a small quick example of a a function that take 1 paramater and based on that parameter, returns a table or view ? Etc .... Note this is just a abstract of the functon, not a working function call !!! Create function viewtest( start_month)=20 If $1 =3D 'April' Then=20 Select * from april_view; Return ; Let me know how to do this. Thanks ------_=_NextPart_001_01C78356.0CDCC83F Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Function to return a multiple colmn table or view

I am new to psql , so please be patient !

Can = someone please provide a small quick example of a a function that take 1 = paramater and based on that parameter, returns a table or view = ?

Etc ….  Note this is just a = abstract of the functon, not a working function call = !!!

Create function viewtest( start_month)

        If $1 =3D ‘April’

        Then

        Select * from april_view;

        Return ;

Let = me know  how to do this.

Thanks

------_=_NextPart_001_01C78356.0CDCC83F--