[Teradata][ODBC Teradata Driver] SQL request exceeds maximum allowed length of 1 MB

Connectivity
Fan

[Teradata][ODBC Teradata Driver] SQL request exceeds maximum allowed length of 1 MB

What does the SQL request mean? Is the maximum allowed length configurable? Why still need the limitation in 64bit ODBC driver? Is there any workaround ?

Thanks

5 REPLIES
Teradata Employee

Re: [Teradata][ODBC Teradata Driver] SQL request exceeds maximum allowed length of 1 MB

Teradata ODBC Driver returns this error if SQL request text combined with data for parameters(?s) exceeded the allowed limit of 1MB.
- Make sure request text is not larger than 1MB in size.
- If parameter array is used, reduce the size of array (SQL_ATTR_PARAMSET_SIZE).
Fan

Re: [Teradata][ODBC Teradata Driver] SQL request exceeds maximum allowed length of 1 MB

So I have to reduce the rows per commit(SQL_ATTR_PARAMSET_SIZE) using parameterized sql(insert xx values (?,?,?))?
Seems oracle and other db didn't have the issue. Why teradata have the restriction?

Thanks
Teradata Employee

Re: [Teradata][ODBC Teradata Driver] SQL request exceeds maximum allowed length of 1 MB

You have to reduce number of rows inserted in one SQLExecDirect() or SQLExecute() call. You do not have to commit after every call. For example,

SQLSetConnectAttr(SQL_ATTR_AUTOCOMMIT, SQL_AUTOCOMMIT_OFF);
SQLPrepare(ins xx values(?,?,?););
While(all rows not inserted)
{
SQLExecute();
}
SQLEndTran(SQL_COMMIT);

Enthusiast

Re: [Teradata][ODBC Teradata Driver] SQL request exceeds maximum allowed length of 1 MB

vhari,

It could be a workaround but NOT good to reduce the rows per commit which had side effect on performance. The max allowed length should be enlarged as today's powerful hardware.

It's nice to be an ODBC configure option to configure the size.

Let me know your concerns.

Teradata Employee

Re: [Teradata][ODBC Teradata Driver] SQL request exceeds maximum allowed length of 1 MB

The maximum allowed length limit is not coming from Teradata ODBC Driver itself, but it is the maximum size of a SQL request(including data for parameters) Teradata database can accept.  ODBC Driver might be able to emulate(by sending multiple 1MB sized SQL requests to Teradata database) as if there is no limit but that is not much different compared to what application can do as on today.