title: How to execute different multiple SQL statements using OracleCommand C#
body: <p>I am trying to execute different SQL statements using OracleCommand.</p>
  
  <pre><code>var conn = new OracleConnection("User Id=SYSTEM;Password=mw;Data Source=SampleDataSource");
  // Open the connection
  if (conn.State != ConnectionState.Open)
      conn.Open();
  
  string sql = @"
      DROP TABLE CUSTOMERS;
  
      CREATE TABLE CUSTOMERS (
          ID INT NOT NULL PRIMARY KEY,
          NAME VARCHAR(12) NOT NULL,
          AGE INT,
          ADDRESS VARCHAR(12)
      );
  
      INSERT INTO CUSTOMERS (ID,NAME,AGE,ADDRESS) VALUES (1, 'Mark', 28, 'NY');
  
      INSERT INTO CUSTOMERS (ID,NAME,AGE,ADDRESS) VALUES (2, 'John', 39, 'LA');
  
      INSERT INTO CUSTOMERS (ID,NAME,AGE,ADDRESS) VALUES (3, 'Andy', 48, 'CA');
  
      INSERT INTO CUSTOMERS (ID,NAME,AGE,ADDRESS) VALUES (4, 'Allan', 53, 'LA');
  ";
  
  var cmd = new OracleCommand(sql, conn);
  try
  {
      cmd.ExecuteNonQuery();
  }
  catch (OracleException e)
  {
      error = e.Message;
  }
  finally
  {
      if (conn.State == ConnectionState.Open)
      {
          conn.Close();
      }
  }
  </code></pre>
  
  <p>I am getting the following exception.</p>
  
  <blockquote>
    <p>ORA-00933: SQL command not properly ended</p>
  </blockquote>
  
  <p>When I enclose the multiple statements in BEGIN, END block then I am getting the following exception.</p>
  
  <blockquote>
    <p>ORA-06550: line 2, column 1:
    PLS-00103: Encountered the symbol "DROP" when expecting one of the following:</p>
    
    <p>( begin case declare exit for goto if loop mod null pragma raise return select update while with    &lt;&lt; continue close current delete fetch lock insert open rollback savepoint set sql execute commit forall merge pipe purge
    json_exists json_value json_query json_object json_array </p>
  </blockquote>