File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Oracle/OAS and the fly likes Problem creating surrogate key Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Products » Oracle/OAS
Bookmark "Problem creating surrogate key" Watch "Problem creating surrogate key" New topic
Author

Problem creating surrogate key

Atanas The dude
Greenhorn

Joined: Mar 30, 2011
Posts: 1
Hi,
I am trying to create a surrogate key so for that purpose I have this sequence:



but when I try to create the following trigger:



I get IN- or OUT-parameter is missing at index:: 1. Any idea why this happens?
Avi Abrami
Ranch Hand

Joined: Oct 11, 2000
Posts: 1121

Atanas The,
You need to change the body of the trigger.
A simple Internet search for the terms "oracle", "trigger", "nextval" will provide the answer.
Try the following:

Good Luck,
Avi.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Problem creating surrogate key
 
Similar Threads
Auto Increment ID Field Table in the Oracle Database
problem with the sequence generated by system
Trigger performance
Problem in using triggers and sequences
What is the better choice for primary key ? natural key or system-generated key ?