Maximum Statement Length

drew_sav

New Member
Hi guys,

I've come accross an issue when i'm trying to update a CLOB through ODBC. We have recently migrated our website DB from mySQL to Progress, and this database stores attachments base64 encoded in a CLOB. The issue i'm having is that i can't get attachments larger than about 22KB to insert into the database. The error suggests that it's hitting the 32KB statement length limit, as that is where the error below occuring.

ERROR [HY000] [DataDirect][ODBC Progress OpenEdge Wire Protocol driver][OPENEDGE]Syntax error in SQL statement at or about "8ADAAARmluZGluZyBOZW1vBgAbABoAAgAPAAAASG" (10713)

Does anyone knows how to get around this statement length problem?

Thanks,
Andrew
 

drew_sav

New Member
It turns out the maximum SQL statement length is non-negotiable at 131000 characters. I was able to fix this issue myself using parameters, similar to this example i found on the progress site for Java with JDBC:

http://progress.atgnow.com/esprogre...e+a+CLOB+/+BLOB+field&resultType=5002#Goto673

Or some C# code i wrote from this example is as follows:

OdbcConnection objConn = new OdbcConnection(sConnection);
OdbcCommand objCmd = new OdbcCommand(sQuery, objConn);
objCmd.Parameters.Add("@p1", OdbcType.Text, sP1.Length).Value = sP1;
objConn.Open();
i = objCmd.ExecuteNonQuery();
objConn.Close();

Hope someone finds this helpful.

Andrew
 
Top