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

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

Postby 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.
nssidhu
 
Posts: 11
Joined: Tue 23 Feb 2010 18:35

Postby 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))
AndreyR
Devart Team
 
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Postby nssidhu » Wed 08 Dec 2010 16:33

that works thanks
nssidhu
 
Posts: 11
Joined: Tue 23 Feb 2010 18:35


Return to dotConnect for Oracle