SQL sequence usuage in ALBPM
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