How to Handle Inserts & Updated to CLOB Field > 4000 chars

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for Oracle
Post Reply
nssidhu
Posts: 11
Joined: Tue 23 Feb 2010 18:35

How to Handle Inserts & Updated to CLOB Field > 4000 chars

Post by nssidhu » Tue 07 Dec 2010 17:30

I am using the following Statement it works fine if the comments are less then 4000 characters, buit fails with error String litral too long, when using more then 40000 characters.

Dim Qry As String = String.Format("UPDATE PTS.LLW_T_LLW SET C_LL24_COMMENT='{0}', Updatedby_security_ID_FK={1} WHERE LLW_ID_PK={2}", LLW.LLW24_Comments, LLW.Updatedby_security_ID_FK, LLW.LLW_ID_PK)
Dim irowsAffected As Integer = Me.ObjectContext.ExecuteStoreCommand(Qry)

I would additinally also like to know, if this will also be a problem when using entities from entity model.

AndreyR
Devart Team
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Post by AndreyR » Wed 08 Dec 2010 13:35

Use the following code instead:

Code: Select all

Dim Qry As String = "UPDATE PTS.LLW_T_LLW SET C_LL24_COMMENT=:p0, Updatedby_security_ID_FK=:p1 WHERE LLW_ID_PK=:p2" 
Dim irowsAffected As Integer = Me.ObjectContext.ExecuteStoreCommand(Qry, new OracleParameter("p0", LLW.LLW24_Comments), new OracleParameter("p1", LLW.Updatedby_security_ID_FK), new OracleParameter("p2", LLW.LLW_ID_PK))

nssidhu
Posts: 11
Joined: Tue 23 Feb 2010 18:35

Post by nssidhu » Wed 08 Dec 2010 16:33

that works thanks

Post Reply