From oracle-l-bounce@freelists.org Wed May 18 00:08:43 2005 Return-Path: Received: from air891.startdedicated.com (root@localhost) by orafaq.com (8.12.10/8.12.10) with ESMTP id j4I58hBG011673 for ; Wed, 18 May 2005 00:08:43 -0500 X-ClientAddr: 206.53.239.180 Received: from turing.freelists.org (freelists-180.iquest.net [206.53.239.180]) by air891.startdedicated.com (8.12.10/8.12.10) with ESMTP id j4I58g4Z011669 for ; Wed, 18 May 2005 00:08:43 -0500 Received: from localhost (localhost [127.0.0.1]) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 9E9A0194403; Tue, 17 May 2005 23:05:53 -0500 (EST) Received: from turing.freelists.org ([127.0.0.1]) by localhost (turing [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 07984-07; Tue, 17 May 2005 23:05:53 -0500 (EST) Received: from turing (localhost [127.0.0.1]) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 22CA81943D2; Tue, 17 May 2005 23:05:53 -0500 (EST) Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; b=VxLdUAVoUQCh8DJfd7nrTA9Oa1Fl5mpSnYskHR27Z1hOnUd+zd6LHCZeS/Cb/FZmKG2jPk6zoat95iKqf6yJ9f1CG6oKbu3PzDvlV64oJZW46WhMpVKSE0Lk/ckztGbx330Xs3+5lxAsR1K2CiXxUuwjYmNwZLbpWi0cPDY6uYY= ; Message-ID: <20050518040404.10605.qmail@web52904.mail.yahoo.com> Date: Tue, 17 May 2005 21:04:03 -0700 (PDT) From: Kean Jacinta Subject: Trigger with sequence To: oracle-l@freelists.org MIME-Version: 1.0 Content-type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit X-archive-position: 19818 X-ecartis-version: Ecartis v1.0.0 Sender: oracle-l-bounce@freelists.org Errors-To: oracle-l-bounce@freelists.org X-original-sender: jacintakean@yahoo.com Precedence: normal Reply-To: jacintakean@yahoo.com X-list: oracle-l X-Virus-Scanned: by amavisd-new-20030616-p9 (Debian) at avenirtech.net X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on air891.startdedicated.com X-Spam-Status: No, hits=0.5 required=5.0 tests=AWL,FORGED_YAHOO_RCVD autolearn=no version=2.63 Hi, I need to figure out how to do this. I have created this table name : myclass table column : id , name, type primary key : id sequence: myclassseq I can use the sequence with insert statement , for example : insert into myclass (id, name, type) values (myclassseq.nextval, 'BT COM', 1) I try to use trigger to insert the seq automatically, so that i can simply issue this : insert into myclass (name, type) values ('BT COM', 1) And my insert statement will still work becoz the trigger will automatically insert a unique id. I created a trigger myclasstr with the body below BEGIN IF INSERTING THEN insert into myclass (id) values (myclass.nextval); END IF; END; WHen i try to insert into my table it will generate error. Pls let me know what has gone wrong ? Your help is very much appreciated Thank You JK Yahoo! Mail Stay connected, organized, and protected. Take the tour: http://tour.mail.yahoo.com/mailtour.html -- http://www.freelists.org/webpage/oracle-l