dbTalk Databases Forums  

java, trigger and sequence

comp.databases.oracle.misc comp.databases.oracle.misc


Discuss java, trigger and sequence in the comp.databases.oracle.misc forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Nicola
 
Posts: n/a

Default java, trigger and sequence - 07-19-2003 , 04:28 AM






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 ?!



Reply With Quote
  #2  
Old   
Daniel Morgan
 
Posts: n/a

Default Re: java, trigger and sequence - 07-19-2003 , 04:07 PM






Nicola wrote:

Quote:
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)




Reply With Quote
  #3  
Old   
Billy Verreynne
 
Posts: n/a

Default Re: java, trigger and sequence - 07-21-2003 , 12:37 AM



Daniel Morgan <damorgan (AT) exxesolutions (DOT) com> wrote

<snipped>

Quote:
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


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.