- ABP Framework version: v5
- UI type: MVC
- DB provider: EF Core
- Tiered (MVC) or Identity Server Separated (Angular): no
- Exception message and stack trace:
- Steps to reproduce the issue:"
5 Answer(s)
-
0
Hello,
My Abp is MVC Razor with Oracle. I'd like to know how to work with Oracle Procedure?
The following sample is working with Store Procedure, but it is for SQL Server. https://github.com/abpframework/abp-samples/tree/master/StoredProcedureDemo
How can i make my project work with Oracle procedure?
Thanks in advance
Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post) -
0
hi
I think you just need to change the syntax of the SQL server to the oracle, the principle is the same.
https://github.com/abpframework/abp-samples/blob/master/StoredProcedureDemo/src/StoredProcedureDemo.EntityFrameworkCore/EntityFrameworkCore/Users/AppUserRepository.cs#L27-L40
Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post) -
0
hi
I think you just need to change the syntax of the SQL server to the oracle, the principle is the same.
https://github.com/abpframework/abp-samples/blob/master/StoredProcedureDemo/src/StoredProcedureDemo.EntityFrameworkCore/EntityFrameworkCore/Users/AppUserRepository.cs#L27-L40
Thank for your reply. please share me a sample function to do that. I don't know that is why i requested you. Honestly, I will copy and paste into my application.
Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post) -
0
Is it correct?
public async Task<List<Student>> GetStudentAsync(CancellationToken cancellationToken = default) { var name = new OracleParameter("Name", OracleDbType.Varchar2, ParameterDirection.Output); var address = new OracleParameter("Address", OracleDbType.Varchar2, ParameterDirection.Output); using (var command = CreateCommand("BEGIN GetStudent(:Name, :Address,);END;", CommandType.Text, new OracleParameter[] { name, address })) { return ((List<Student>)await command.ExecuteScalarAsync(cancellationToken)); } } private DbCommand CreateCommand(string commandText, CommandType commandType, params OracleParameter[] parameters) { var command = DbContext.Database.GetDbConnection().CreateCommand(); command.CommandText = commandText; command.CommandType = commandType; command.Transaction = DbContext.Database.CurrentTransaction?.GetDbTransaction(); foreach (var parameter in parameters) { command.Parameters.Add(parameter); } return command; }Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post) -
0
hi
I'm not familiar with Oracle, you can try your solution.
https://www.google.com/search?q=oracle+entity+framework+core+execute+stored+procedure&oq=ORACLE+EF+CORE+EXEC+&aqs=chrome.1.69i57j0i22i30.5767j0j7&sourceid=chrome&ie=UTF-8
Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)