switch statement in plpgsql

From: Godshall Michael <Michael_Godshall(at)gmachs(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: switch statement in plpgsql
Date: 2003-07-29 16:18:38
Message-ID: A596FA3368757645AF862C701495CA000138CB74@hor1mspmx01.gmachs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Hello,

Is it possible to use a case switch statement in a plpgsql function or must
I use If-Else statements only?

If so what is the format?

I have tried the following which when compiled is accepted but when I call
the function it crashes.

switch(tregion)

{

case : ''San Ramon'' then tregion := ''San Ramon, CA'';

break;

}

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Mel Jamero 2003-07-29 16:20:36 Re: help: now() + N is now failing!
Previous Message Tom Lane 2003-07-29 16:17:04 Re: help: now() + N is now failing!