Does anyone know if its possible to call an oracle's sequence.NextVal from ef4 without using StoredProcedure? I have an Oracle db 开发者_运维知识库from a client which I cannot modify, so stroedproc are not an option for me. I use ef4 ctp5.
Thank!
For example, you can execute an SQL command:
OracleParameter param = new OracleParameter("p", OracleDbType.Integer, System.Data.ParameterDirection.Output);
oContext.Database.SqlCommand("begin SELECT sequence_name.nextval into :p FROM dual; end;", param);
int i = (int)param.Value;
I have tested this code using dotConnect for Oracle 6.0.86, it works.
I'm not familiar with ef4 but can you execute regular queries like this?
SELECT sequence_name.nextval
FROM dual;
精彩评论