Unix Technical Forum

java, trigger and sequence

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 ...


Go Back   Unix Technical Forum > Database Server Software > Oracle Database > Oracle Miscellaneous

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-07-2008, 09:06 AM
Nicola
 
Posts: n/a
Default java, trigger and sequence

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


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-07-2008, 09:07 AM
Daniel Morgan
 
Posts: n/a
Default Re: java, trigger and sequence

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)


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-07-2008, 09:07 AM
Billy Verreynne
 
Posts: n/a
Default Re: java, trigger and sequence

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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
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
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 05:26 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com