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

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 (view raw or flat)
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

pgsql-novice by date

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

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