title: ORA-00922: missing or invalid option When trying to execute PL/SQL from C#
body: <p>I am almost positive this is user error. </p>
  
  <p>I am new to connecting C# to an Oracle database and have modeled my code after that in the <a href="http://download.oracle.com/docs/cd/B19306_01/win.102/b14307/featRefCursor.htm" rel="nofollow">Oracle online documentation</a> </p>
  
  <p>My PL/SQL works from within Oracle SQL Developer. The error I am getting in my test.aspx page is: </p>
  
  <blockquote>
    <p>ORA-00922: missing or invalid option </p>
  </blockquote>
  
  <p>The code behind in the test.aspx.cs page is:</p>
  
  <pre><code>string currentTerm = getCurrentTerm();
      string passwd = "&lt;get password input&gt;";
      string salt = "&lt;get salted input&gt;";
  
      conn.ConnectionString = ConfigurationManager.ConnectionStrings["CONNECTIONSTRINGNAME"].ConnectionString;
  
          conn.Open();
  
          // pl/sql block
          string pl_sql = "  set serveroutput on " +
                                      "DECLARE"+
                                      "   output                 tablename.function%TYPE;" +
                                      "BEGIN"+
                                      "   tablename.myfunction(:1,:2,:3);" +
                                      "   dbms_output.put_line('output= '||output"+
                                      "END;";
  
          //Oracle Parameters necessary for the myfunction function
          OracleParameter p_1 = new OracleParameter(passwd, OracleDbType.Varchar2, 50, ParameterDirection.Input);
          OracleParameter p_2 = new OracleParameter(salt, OracleDbType.Varchar2, 50, ParameterDirection.Input);
          OracleParameter p_3 = new OracleParameter("3", OracleDbType.Varchar2, 50, ParameterDirection.Output);
  
          // create the command object
          OracleCommand cmd = conn.CreateCommand();
          cmd.CommandText = pl_sql;
  
          // add the parameters
          cmd.Parameters.Add(p_1);
          cmd.Parameters.Add(p_2);
          cmd.Parameters.Add(p_3);
  
          // execute the pl/sql block
          cmd.ExecuteNonQuery();
  
          // get a data reader from the ref cursor 
          //    note: this is on p_3, the output value
          OracleDataReader dr = ((OracleRefCursor)p_3.Value).GetDataReader();
  
          while (dr.Read())
          {
  
              Response.Write("Salt licked hash: "+ dr[0].ToString());
              //Output the line retrieved from dbms_output.put line
              Response.Write("&lt;br /&gt;");
              Response.Write("DBMS_OUTPUT STATUS: "+ p_3.Value.ToString());
  
          }
  </code></pre>