pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Ramesh Patel <ramesh@banasdairy.coop>
To: pgsql-sql@postgresql.org
Subject: Problem in SQL Trigger
Date: Fri, 30 Apr 2004 10:18:18 +0530 (IST)
Message-ID: <1118.10.1.1.251.1083300498.squirrel@banasdairy.coop> (raw)

<p><br />Hi<br />i have one problem in Trigger.<br />this trigger alread
work<br />on Red Hat Linux 7.3 but now i shift to RHL9.0<br />in RHL 9.0 
not<br />working . in this problem in ROUND function.<br />but how to i
slove this<br />i dont know. so please help me.<br />This is  Function
and<br />Trigger.<br />/////////////////////////// Function
Start//////////////////////////////////////////<br />CREATE<br />FUNCTION
add_issue_fun() returns opaque as'<br />BEGIN<br />UPDATE<br />mtrl_mst
<br />set balstk_cs = balstk_cs -<br />NEW.issueqty_cs,<br />balstk_mt =
round( cast((balstk_mt -<br />NEW.issueqty_mt) as numeric ),4)<br />where
mtrl_mst.mtrl_code =<br />NEW.mtrl_code;<br />UPDATE rcpt_detail <br />set
consqty_cs=consqty_cs +<br />NEW.issueqty_cs<br />WHERE
rcpt_detail.batch_code = NEW.batch_code<br /><br />and
rcpt_detail.mtrl_code = NEW.mtrl_code<br />and<br />rcpt_detail.loc_code =
NEW.loc_code;<br />return<br />NULL;<br />END;'<br />language
'plpgsql';<br /><br />///////////////////////////
Function End//////////////////////////////////////////<br
/>///////////////////////////Trigger Start
//////////////////////////////////////////<br />CREATE<br />TRIGGER
add_issue_trg<br />AFTER INSERT ON issue_detail<br />FOR EACH<br />ROW
EXECUTE PROCEDURE add_issue_fun();<br /><br />///////////////////////////
Trigger End//////////////////////////////////////////<br
/></p><p>Thanking<br /><br /><br />Ramesh Patel <br />Computer Dept. <br
/>Banasdairy, Palanpur </p>



view thread (2+ messages)  latest in thread

Message-ID: <1118.10.1.1.251.1083300498.squirrel@banasdairy.coop>
Permalink:  ../1118.10.1.1.251.1083300498.squirrel@banasdairy.coop/
Also on:    postgresql.org/message-id/1118.10.1.1.251.1083300498.squirrel@banasdairy.coop

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: ramesh@banasdairy.coop
  Subject: Re: Problem in SQL Trigger
  In-Reply-To: <1118.10.1.1.251.1083300498.squirrel@banasdairy.coop>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox