ElseIF in PLPGSQL

From: denis(at)coralindia(dot)com
To: <pgsql-novice(at)postgresql(dot)org>
Subject: ElseIF in PLPGSQL
Date: 2002-02-28 08:39:35
Message-ID: 010101c1c033$74da1940$0232a8c0@coralindia.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice


Hi all,

I have created one function and i want to use

IF
.........do something...
ELSEIF
.........do something...
ELSE
.........do something...
END IF;

My ELSEIF condition is TRUE but still it goes into ELSE condition ???

Is this a problem or ???

Thanx

Denis

----- Original Message -----
From: "Clinton Adams" <clinton(at)vote-smart(dot)org>
To: <pgsql-novice(at)postgresql(dot)org>
Sent: Thursday, February 28, 2002 6:18 AM
Subject: [NOVICE] Stored Procedures and Return Type

> Hello,
>
> What would be the rtype for a function to return tuples selected over more
> than one table? The closest I can find is setof but this rtype is for all
> columns of only one table.
>
> Example:
>
> states
> state_id integer
> state_name varchar
> state_abbreviation char(2)
>
> districts
> district_id integer
> state_id integer
> district_name varchar
>
>
> CREATE OR REPLACE FUNCTION districts(varchar, varchar) RETURNS ???? AS '
> SELECT state_name, districtname FROM states s, districts d
> WHERE s.state_id = d.state_id AND s.state_name = $1 AND d.district_name =
$2;
> ' LANGUAGE 'sql';
>
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo(at)postgresql(dot)org so that your
> message can get through to the mailing list cleanly

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message pgsql 2002-02-28 09:44:18 Re: phppgadmin
Previous Message PG Explorer 2002-02-28 05:40:40 Re: PHP + PostgreSQL