0
다음 기능을 실행하려고합니다. 그러나 명령이 제대로 끝나지 않아 오류가 발생합니다. 하지만 데이터베이스에서 실행 중일 때 제대로 실행되고 있습니다 :단일 쿼리에서 다중 삭제 문
string sql = @"Delete FROM table1 WHERE idtest in (Select istest from table12 Where case_id=:caseID);
Delete from table12 Where case_id=:caseID ;
Delete from table13 Where case_id=:caseID ;
Delete from table14 Where case_id=:caseID ;
Delete from table15 Where case_id=:caseID ;
";
using (OracleConnection Conn = new OracleConnection())
{
try
{
oh.InitOraConn(Conn);
using (OracleCommand cmd = new OracleCommand("", Conn))
{
cmd.Connection = Conn;
cmd.CommandText = sql;
cmd.Parameters.Add("caseID", caseId);
cmd.ExecuteNonQuery();
}
}
catch (Exception Ex)
{
throw Ex;
}
}
그래서 잘못된 정보를 알려주십시오.
[답변] (https://stackoverflow.com/questions/31917301/execute-multiple-queries-in-single-oracle-command-in-c-sharp/31918260#31918260) 도움이 될 것입니다. –
만약 내가 틀렸어도 PL/SQL 블록에 모든 SQL을 래핑 할 수 있다면 나에게 모두 맞을까요? –