Skip to Main Content

Integration

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

SQL sequence usuage in ALBPM

user647659Jul 18 2008 — edited Jul 21 2008
How do we use the sequence of SQL in ALBPM....I entered the sequence in the db schema using the following query..

CREATE SEQUENCE "EMPLOYEE"."EMPLOYEEID" MINVALUE 1 MAXVALUE 9999999999999999 INCREMENT BY 1 START WITH 1 CACHE 20 NOORDER NOCYCLE ;

How do we use this sequence while inserting data into the EMPLOYEE table:-

Is the following code correct:-

String sqlQuery = "SELECT EMPLOYEE_SEQ.nextVal as employeeID FROM DUAL";
try {

// set a timeout of 180 seconds on the DDA query
DynamicSQL.queryTimeout = 180;

ddaitems = DynamicSQL.executeQuery(sentence : sqlQuery, implname : "EMPLOYEE");

foreach (ddarow in ddaitems) {
logMessage("DDA Items ID = "+(String)ddarow["employeeID"]);

employee.id=(String)ddarow["employeeID"];
}
employee.employeeID=Long.parseLong(arg1 : employee.id);
logMessage("inserting record for employee ID = " +employee.employeeID);

INSERT INTO EMPLOYEE(employeeId)
VALUES ( employee.employeeID);
}

here the table name is EMPLOYEE

The schema name is also EMPLOYEE

The ALBPM object name is also EMPLOYEE

But this gives me the following JDBC error:-

A SQL Exception has occured in /EmployeeChallenge#Default-1.0/1/0@EMPLOYEE
Cause f SQL Excepion: java.sql.SQLException: [BEA][Oracle JDBC Driver][Oracle]ORA-02289: sequence does not exist

SQLState: HY000 SQLErrorCode: 2289
Message: [BEA][Oracle JDBC Driver][Oracle]ORA-02289: sequence does not exist

Although I have created the sequence, it says sequence does not exist.

Message was edited by:
user647659
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 18 2008
Added on Jul 18 2008
2 comments
1,834 views