Never seen this one before Sap.Data.SQLAnywhere.SAException (0x80004005): The pattern is too long at Sap.Data.SQLAnywhere.SACommand._ExecuteReader(CommandBehavior commandBehavior, Boolean isExecuteScalar, Boolean isBeginExecuteReader) at Sap.Data.SQLAnywhere.SACommand.ExecuteReader() at Sap.Data.SQLAnywhere.SADataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet) What does 'pattern too long' mean? Can't get find anything for that in Google |
Think I have figured it out. The SQL was SELECT Invoice_No as Document, Type, Invoice_Date as 'Date', Customer_Name as 'Name', Details, Amount_Gross as 'Amount', Printed, Posted FROM A_Invoices WHERE (Customer_Name LIKE '% %' OR Details LIKE '% %') AND Invoice_Date BETWEEN '2016-08-30' AND '2017-08-30' ORDER BY Invoice_No The user was searching for a name that matched 206 blank spaces. I'm guessing she rested her plate, with an afternoon snack, on the spacebar :-) TRIM() may have helped:) Note, LIKE patterns are limited to 126 bytes, and longer patterns should give a -606 SQLCODE.
(15 Sep '17, 03:49)
Volker Barth
|
SQL Anywhere errors are documented in the "SQL Anywhere - Error Messages document". There are several ways to find an error including by message text. If you encounter an SQL Anywhere based error, I would check this document first.
The error is documented here (using SA17 documentation): http://dcx.sap.com/index.html#sqla170/en/html/80e18e026ce21014b92ae2d6bf718050.html
The documentation states: The pattern for the LIKE operator is too long. All patterns of 126 characters or less are supported. Some patterns as long as 254 characters are supported, depending on their contents. Patterns longer than 254 characters are not supported.