X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id CD544D1DC9D for ; Fri, 30 Apr 2004 01:46:23 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 30527-04 for ; Fri, 30 Apr 2004 01:46:04 -0300 (ADT) Received: from localhost.localdomain (unknown [203.199.30.202]) by svr1.postgresql.org (Postfix) with ESMTP id 87628D1DF8B for ; Fri, 30 Apr 2004 01:45:48 -0300 (ADT) Received: from localhost.localdomain (ns1 [127.0.0.1]) by localhost.localdomain (8.12.8/8.11.6) with ESMTP id i3U4mKRk010412 for ; Fri, 30 Apr 2004 10:18:20 +0530 Received: (from apache@localhost) by localhost.localdomain (8.12.8/8.12.8/Submit) id i3U4mJh3010410; Fri, 30 Apr 2004 10:18:19 +0530 X-Authentication-Warning: localhost.localdomain: apache set sender to ramesh@banasdairy.coop using -f Received: from 10.1.1.251 (SquirrelMail authenticated user ramesh) by banasdairy.coop with HTTP; Fri, 30 Apr 2004 10:18:18 +0530 (IST) Message-ID: <1118.10.1.1.251.1083300498.squirrel@banasdairy.coop> Date: Fri, 30 Apr 2004 10:18:18 +0530 (IST) Subject: Problem in SQL Trigger From: "Ramesh Patel" To: pgsql-sql@postgresql.org User-Agent: SquirrelMail/1.4.2-1 MIME-Version: 1.0 Content-Type: text/html;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Priority: 3 Importance: Normal X-Virus-Scanned: by amavisd-new at postgresql.org X-Spam-Status: No, hits=2.6 tagged_above=0.0 required=5.0 tests=HTML_MESSAGE, HTML_MIME_NO_HTML_TAG, MIME_HTML_ONLY, PRIORITY_NO_NAME X-Spam-Level: ** X-Archive-Number: 200404/330 X-Sequence-Number: 17705


Hi
i have one problem in Trigger.
this trigger alread work
on Red Hat Linux 7.3 but now i shift to RHL9.0
in RHL 9.0  not
working . in this problem in ROUND function.
but how to i slove this
i dont know. so please help me.
This is  Function and
Trigger.
/////////////////////////// Function Start//////////////////////////////////////////
CREATE
FUNCTION add_issue_fun() returns opaque as'
BEGIN
UPDATE
mtrl_mst
set balstk_cs = balstk_cs -
NEW.issueqty_cs,
balstk_mt = round( cast((balstk_mt -
NEW.issueqty_mt) as numeric ),4)
where mtrl_mst.mtrl_code =
NEW.mtrl_code;
UPDATE rcpt_detail
set consqty_cs=consqty_cs +
NEW.issueqty_cs
WHERE rcpt_detail.batch_code = NEW.batch_code

and rcpt_detail.mtrl_code = NEW.mtrl_code
and
rcpt_detail.loc_code = NEW.loc_code;
return
NULL;
END;'
language 'plpgsql';

/////////////////////////// Function End//////////////////////////////////////////
///////////////////////////Trigger Start //////////////////////////////////////////
CREATE
TRIGGER add_issue_trg
AFTER INSERT ON issue_detail
FOR EACH
ROW EXECUTE PROCEDURE add_issue_fun();

/////////////////////////// Trigger End//////////////////////////////////////////

Thanking


Ramesh Patel
Computer Dept.
Banasdairy, Palanpur