What are the Oracle best practices to return data to c# -


i totally green oracle , looking best practice calling , retrieving data oracle db.

in c# can this...

    oraclecommand cmd = new oraclecommand();     cmd.connection = conn;     cmd.commandtext = "select * mytable id = 3";     cmd.commandtype = commandtype.text;      oracledatareader dr = cmd.executereader();     dr.read();     string lastname = dr.get<string>("a_field_1"); 

however want create stored proc in oracle return data table back. example "select * mytable".

is better practice create stored proc in oracle, maybe utilize function or in line in code base?

i prefer create stored proc, struggling syntax necessary accomplish simple task.

it best practice create stored procedure rather using dynamic sql in c#. in case can create simple procedure this;

create procedure myproc (prc out sys_refcursor) begin    open prc select * mytable id = 3 end; 

however, klaudiusz points out you, use kind of orm.


Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -