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
Post a Comment