go-xorm / xorm

Simple and Powerful ORM for Go, support mysql,postgres,tidb,sqlite3,mssql,oracle, Moved to https://gitea.com/xorm/xorm
BSD 3-Clause "New" or "Revised" License
6.67k stars 754 forks source link

Auto Increment doesn't work properly in Oracle #1039

Open rofly opened 6 years ago

rofly commented 6 years ago

When a field has the tag "autoincr", in the insert process Xorm will always try to select the next value for the sequence from a fixed sequence, named:

https://github.com/go-xorm/xorm/blob/master/session_insert.go#L386

Instead of having an option to specify the sequence name that the value should be extracted from.

lunny commented 6 years ago

Please feel free to send a PR.

yixin19 commented 5 years ago

Did someone fix this issue? I have the same problem. ORA-01036: illegal variable name/number

rofly commented 5 years ago

I started building the code for autoincrement back in 2018, but the project i was working on was canceled and I'm no longer working with Go + Oracle.

I can take a look in the code on monday and reply here.

yixin19 commented 5 years ago

I started building the code for autoincrement back in 2018, but the project i was working on was canceled and I'm no longer working with Go + Oracle.

I can take a look in the code on monday and reply here.

I will appreciate it if you have the code