locked
File upload to blob Oracle Issue. RRS feed

  • Question

  • User1886136108 posted

    Hi,

    I am trying to upload file to blob Oracle using C#. when file size getting less its working fine but when file size getting more its showing error i.e

    "Exception Message : ORA-01460: unimplemented or unreasonable conversion requested"

    My code:-

    FileStream fls;

    fls = new FileStream(filePath, FileMode.Open, FileAccess.Read);
    //a byte array to read the image
    byte[] blob = new byte[fls.Length];
    fls.Read(blob, 0, System.Convert.ToInt32(fls.Length));
    fls.Close();

    cmd = objcommon.createCommand("PKG_mypkg.sp_BulletinBoard");
    cmd.Parameters.Add("p_CMMON_DOC_NM", OracleType.VarChar).Value = objBulletinBoard.fileName;
    cmd.Parameters.Add("p_CMMON_DOC_OBJ_BLOB", OracleType.Blob).Value = blob;
    cmd.Parameters.Add("p_CMMON_DOC_DESCN_TXT", OracleType.VarChar).Value = objBulletinBoard.docDescription == null ? "" : objBulletinBoard.docDescription;
    cmd.Parameters.Add("p_LAST_UPDTR_NTID", OracleType.VarChar).Value = objBulletinBoard.ntid;
    cmd.Parameters.Add("p_CMMON_DOC_DISPLYD_NM", OracleType.VarChar).Value = objBulletinBoard.docName;
    cmd.Parameters.Add("p_CMMON_DOC_TYP", OracleType.VarChar).Value = objBulletinBoard.docType;
    cmd.ExecuteNonQuery();

    Tuesday, June 14, 2016 9:52 AM

Answers

  • User61956409 posted

    Hi Dillip_Chhatoi,

    I am trying to upload file to blob Oracle using C#. when file size getting less its working fine but when file size getting more its showing error i.e

    "Exception Message : ORA-01460: unimplemented or unreasonable conversion requested"

    Firstly, it seems an Oracle database error, please make sure if parameter blob value is larger than the max length of BLOB type.

    Secondly, you could upload the file on server then store the file server path in your database.

    Best Regards,

    Fei Han

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, June 15, 2016 5:40 AM

All replies

  • User61956409 posted

    Hi Dillip_Chhatoi,

    I am trying to upload file to blob Oracle using C#. when file size getting less its working fine but when file size getting more its showing error i.e

    "Exception Message : ORA-01460: unimplemented or unreasonable conversion requested"

    Firstly, it seems an Oracle database error, please make sure if parameter blob value is larger than the max length of BLOB type.

    Secondly, you could upload the file on server then store the file server path in your database.

    Best Regards,

    Fei Han

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, June 15, 2016 5:40 AM
  • User632428103 posted

    Hello all,

    never try to insert a blob into oracle but read this topic :

    http://forums.asp.net/t/581194.aspx

    or this one :

    http://stackoverflow.com/questions/3557995/issues-calling-stored-procedure-from-c-sharp-with-large-clob

    hope this help

    Wednesday, June 15, 2016 7:14 AM