Re: Is there a GoTo ? - Mailing list pgsql-general

From Adrian Klaver
Subject Re: Is there a GoTo ?
Date
Msg-id 872cd0ac-1edc-2c75-290e-1ab88138684f@aklaver.com
Whole thread Raw
In response to Is there a GoTo ?  (İlyas Derse <ilyasderse@gmail.com>)
List pgsql-general
On 1/16/20 2:48 AM, İlyas Derse wrote:
> In this function I have to GOTO to a label1, but GOTO keyword is not 
> working, can you please help me in getting the way from which I am able 
> to jump from a particular code to label.
>   Thanks...
> 
> |CREATEORREPLACE FUNCTIONtest(i integer)RETURNS integer 
> AS$$BEGINIFi<0THENRETURNi 
> +1;ELSEGOTOlabel1;ENDIF<<label1>>RETURNnull;END;$$LANGUAGE plpgsql;|
> 

Are you looking for EXIT?:

https://www.postgresql.org/docs/12/plpgsql-control-structures.html#PLPGSQL-CONDITIONALS
42.6.5.2. EXIT

-- 
Adrian Klaver
adrian.klaver@aklaver.com



pgsql-general by date:

Previous
From: Michael Nolan
Date:
Subject: Re: Can I do this?
Next
From: Justin
Date:
Subject: Re: Can I do this?