none
How to insert data into CLOB column? RRS feed

  • Question

  • Hi,

    I'm getting an OracleException {"ORA-01036: illegal variable name/number\n"} while inserting into CLOB column.

    This is my code:

     

    OracleConnection con = new OracleConnection("Data Source=Xe;User Id=sa;Password=system;Integrated Security=no;");

    string strSQL = "INSERT INTO myTable ( Id, BlobData, myTimeStamp, myUserName) " +

    " VALUES ( myTable_seq.nextval, @BlobData, sysdate, 'sa' )";

     

    System.IO.StreamReader myStream = new System.IO.StreamReader(System.IO.File.OpenRead(dlscFile));

    string dlsc = myStream.ReadToEnd();

     

    OracleParameter par1 = new OracleParameter("@LicenseData", OracleType.Clob, dlsc.Length);

    par1.Value = dlsc;

     

    OracleCommand com = new OracleCommand(strSQL, con);

    com.Parameters.Add(par1);

     

    con.Open();

    int rowsAffected = com.ExecuteNonQuery();  <--- EXCEPTION!

    con.Close();

     

    Can anyone suggest what's wrong?????

    Also, is there a System.Data.DbType equivalent of a CLOB?

    Thank you.
    Monday, October 1, 2007 2:58 PM

Answers