atau form.
CREATE OR REPLACE TRIGGER RISAN.AUT_ABC
BEFORE UPDATE
ON RISAN.ABC
REFERENCING NEW AS NEW OLD AS OLD
FOR EACH ROW
DECLARE
tmpVar NUMBER;
BEGIN
IF (:NEW.BARANG <> :OLD.BARANG) OR (:NEW.CODE1 <> :OLD.CODE1) OR
(:NEW.CODE2 <> :OLD.CODE2)THEN
SELECT NVL(MAX(NVL(URUT,0)),0) +1 INTO tmpVar
FROM ABC
WHERE CODE1 = :NEW.CODE1 AND CODE2 = :NEW.CODE2
AND BARANG = :NEW.BARANG;
:NEW.URUT := tmpVar;
END IF;
EXCEPTION
WHEN OTHERS THEN
-- Consider logging the error and then re-raise
RAISE;
END ;
-----Original Message-----
From: [email protected] [mailto:[EMAIL PROTECTED]
On Behalf Of aly rmb
Sent: Friday, May 12, 2006 7:23 PM
To: [email protected]
Subject: [indo-oracle] Bikin trigger
Sorry klo pertanyaan spt ini sudah pernah mampir.
table ABC
--------------
Code1 Code2 Barang Urut Harga
------------------ ------- ---------- ------
---------
AAA A1 BARANG A 1 1000
AAA A1 BARANG A 2 2000
AAA B1 BARANG B 1 5000
AAA B1 BARANG B 2 3000
Setiap ada penambahan/perubahan di table ABC, colomn urut slalu +1
Pertanyaannya :
Bagaimana cara bikin Triggernya untuk merubah baris ke 2 yg tadinya
HARGA = 2000 menjadi 3000 tanpa merubah colomn urut ?
atau merubah baris ke 2, BARANG A menjadi BARANG C berarti urut = 1
atau merubah baris ke 2, BARANG A menjadi BARANG B berarti urut = 3
dan sebaiknya triger itu di level Form, Block atau di mana ya ?
makasih atas bantuannya ....
tks/aly
Send instant messages to your online friends
http://uk.messenger.yahoo.com
[Non-text portions of this message have been removed]
--
-----------I.N.D.O - O.R.A.C.L.E---------------
Keluar: [EMAIL PROTECTED]
Website: http://indo-oracle.lizt.org (NEW)
-----------------------------------------------
Bergabung dengan Indonesia Thin Client User Groups,
Terminal Server, Citrix, New Moon Caneveral, di:
http://indo-thin.vze.com
_____
YAHOO! GROUPS LINKS
* Visit your group "indo-oracle
<http://groups.yahoo.com/group/indo-oracle> " on the web.
* To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]>
* Your use of Yahoo! Groups is subject to the Yahoo!
<http://docs.yahoo.com/info/terms/> Terms of Service.
_____
[Non-text portions of this message have been removed]
--
-----------I.N.D.O - O.R.A.C.L.E---------------
Keluar: [EMAIL PROTECTED]
Website: http://indo-oracle.lizt.org (NEW)
-----------------------------------------------
Bergabung dengan Indonesia Thin Client User Groups,
Terminal Server, Citrix, New Moon Caneveral, di:
http://indo-thin.vze.com
YAHOO! GROUPS LINKS
- Visit your group "indo-oracle" on the web.
- To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
- Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.

