Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: java, trigger and sequence

Re: java, trigger and sequence

From: Daniel Morgan <damorgan_at_exxesolutions.com>
Date: Sat, 19 Jul 2003 14:07:22 -0700
Message-ID: <3F19B30A.2FD00AA0@exxesolutions.com>


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/extinfo/certprog/oad/oad_crs.asp
damorgan_at_x.washington.edu
(replace 'x' with a 'u' to reply)
Received on Sat Jul 19 2003 - 16:07:22 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US