fix native sequence for oracle
This commit is contained in:
parent
89382502cd
commit
76738f569b
|
@ -1086,18 +1086,19 @@ public class DB_Oracle implements AdempiereDatabase
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getNextID(String Name) {
|
public int getNextID(String Name) {
|
||||||
int m_sequence_id = DB.getSQLValue(null, "SELECT "+Name.toUpperCase()+".nextid FROM DUAL");
|
int m_sequence_id = DB.getSQLValue(null, "SELECT "+Name.toUpperCase()+".nextval FROM DUAL");
|
||||||
return m_sequence_id;
|
return m_sequence_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean createSequence(String name , int increment , int minvalue , int maxvalue ,int start , String trxName)
|
public boolean createSequence(String name , int increment , int minvalue , int maxvalue ,int start , String trxName)
|
||||||
{
|
{
|
||||||
|
|
||||||
int no = DB.executeUpdateEx("CREATE SEQUENCE "+name.toUpperCase()
|
int no = DB.executeUpdateEx("CREATE SEQUENCE "+name.toUpperCase()
|
||||||
+ " INCREMENT BY " + increment
|
+ " MINVALUE " + minvalue
|
||||||
|
+ " MAXVALUE " + maxvalue
|
||||||
+ " START WITH " + start
|
+ " START WITH " + start
|
||||||
+ " MIN VALUE " + minvalue
|
+ " INCREMENT BY " + increment +" CACHE 20", trxName)
|
||||||
+ " MAX VALUE " + maxvalue, trxName);
|
;
|
||||||
if(no == -1 )
|
if(no == -1 )
|
||||||
return false;
|
return false;
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in New Issue