We need to create a sequence to fill the primary key of a payment orders table.
The sequence number composed of :
(the first two digits of the current year - dept id - serial )
Ex :
129010001
139010001
139010002
135500001
135500002
Steps to accomplish the task :
The sequence number composed of :
(the first two digits of the current year - dept id - serial )
Ex :
129010001
139010001
139010002
135500001
135500002
Steps to accomplish the task :
- Create a PL/SQL function that deals with creating sequences
- Inside payment EO , Call PL/SQL function from doDml method
- Pass the arguments .
- Get the result and assign it to the primary key or the target attribute
CallableStatement cs=
getDBTransaction().createCallableStatement ("begin ? := PAY_ORDER_SEQ(?,?) ; end;", 0);
PL/SQL function