Batch multiple select statements when calling Oracle from ADO.NET

后端 未结 4 1175
猫巷女王i
猫巷女王i 2020-12-10 12:05

I want to batch multiple select statements to reduce round trips to the database. The code looks something like the pseudo code below. It works perfectly on SQL Server, but

4条回答
  •  暖寄归人
    2020-12-10 13:10

    why not use stored procedures instead?

    But, if you want to batch them in an inline query, you can use a semicolon (;) to seperate the statements.

    var sql = @"BEGIN
                    select * from table1;
                    select * from table2;
                    select * from table3;
                END;";
    

    EDIT: You take a look at this SO question.

    EDIT2: Take a look at this answer.

提交回复
热议问题