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

Raise Notice

From: "Prasad dev" <esteem3300(at)hotmail(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: Raise Notice
Date: 2005-06-20 00:27:41
Message-ID: BAY103-F3758E553854EBDF9A9845AC0E90@phx.gbl (view raw or flat)
Thread:
Lists: pgsql-novice
<html><div style='background-color:'><DIV class=RTE>Hi, </DIV>
<DIV class=RTE>&nbsp;</DIV>
<DIV class=RTE>&nbsp;I have been trying to figure out why this simple query doesn't execute if no record exist ! </DIV>
<DIV class=RTE>&nbsp;</DIV>
<DIV class=RTE>CREATE OR REPLACE FUNCTION del_rest() RETURNS TRIGGER AS '<BR>DECLARE<BR>&nbsp;&nbsp;&nbsp; t record;<BR>&nbsp; BEGIN<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SELECT * INTO t FROM del2 WHERE (d2=OLD.d2 or old.d2 is null) and (d3=OLD.d3 or&nbsp; old.d2 is null);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; IF NOT FOUND THEN<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; RAISE NOTICE ''No such record exits in table del2'';<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; END IF;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return null;&nbsp;&nbsp; <BR>&nbsp;&nbsp; END;<BR>'LANGUAGE 'plpgsql';</DIV>
<DIV class=RTE>&nbsp;</DIV>
<DIV class=RTE>Looking forward for suggestions. Thanks</DIV>
<DIV class=RTE>&nbsp;</DIV>
<DIV class=RTE>Prasad.</DIV></div></html>



Attachment: unknown_filename
Description: text/html (1.0 KB)

Responses

pgsql-novice by date

Next:From: Tom LaneDate: 2005-06-20 01:11:27
Subject: Re: help with function .. .. date data type
Previous:From: Tom LaneDate: 2005-06-19 18:20:50
Subject: Re: BIG files

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