This is a discussion on java, trigger and sequence within the Oracle Miscellaneous forums, part of the Oracle Database category; --> I have to create a trigger that, using java class, calculates a barcode (EAN13) ena having in input a ...
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| I have to create a trigger that, using java class, calculates a barcode (EAN13) ena having in input a number from an autoincrement object (sequence ?). This is my incomplete code. CREATE AND COMPILE JAVA SOURCE NAMED "EAN13" AS import java.lang.*; public class EAN13 { public static void getBarcode (String code){ ............ } } CREATE PROCEDURE PROCEAN13(code VARCHAR2) AS LANGUAGE JAVA NAME 'EAN13.getBarcode(java.lang.String)'; CREATE TRIGGER TRG_EAN13 BEFORE INSERT OR UPDATE OF barcode ON prova FOR EACH ROW CALL PROCEAN13(:new.barcode) CREATE TABLE prova ( barcode char(13), name ( VARCHAR(40)) I don't know how to get in input to PROCEAN13 a sequence value. I try to limit code to example written on top of this page but when I try to create TRIGGER oracle says: columns is an invalid column ! Please help me ?! |
| |||
| Nicola wrote: > I have to create a trigger that, using java class, calculates a barcode (EAN13) ena having in input a number from an autoincrement object (sequence ?). > > This is my incomplete code. > > > > CREATE AND COMPILE JAVA SOURCE NAMED "EAN13" AS > import java.lang.*; > public class EAN13 { > public static void getBarcode (String code){ ............ } > } > > CREATE PROCEDURE PROCEAN13(code VARCHAR2) > AS LANGUAGE JAVA > NAME 'EAN13.getBarcode(java.lang.String)'; > > CREATE TRIGGER TRG_EAN13 > BEFORE INSERT OR UPDATE OF barcode ON prova > FOR EACH ROW CALL PROCEAN13(:new.barcode) > > CREATE TABLE prova ( barcode char(13), name ( VARCHAR(40)) > > I don't know how to get in input to PROCEAN13 a sequence value. > > I try to limit code to example written on top of this page but when I try to create TRIGGER oracle says: > > columns is an invalid column ! > > > > Please help me ?! > If you are a member of the Oracle community ... and that appears to be the case ... please demonstrate courtesy to us by not cross-posting and posting in the appropriate usenet group: That means comp.databases.oracle.marketplace. I will NOT purchase any of your books, nor will I encourage my summer students to do so, until you apologize and promise to not cross-post and not spam again. Thank you. -- Daniel Morgan http://www.outreach.washington.edu/e...ad/oad_crs.asp damorgan@x.washington.edu (replace 'x' with a 'u' to reply) |
| ||||
| Daniel Morgan <damorgan@exxesolutions.com> wrote <snipped> > I will NOT purchase any of your books, nor will I encourage my summer > students to do so, until you apologize and promise to not cross-post and > not spam again. > > Thank you. Er.. Daniel? Can I please now have my lead pipe back? ;-) -- Billy |