cancel
Showing results for 
Search instead for 
Did you mean: 

The pattern is too long

2,260

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

Accepted Solutions (1)

Accepted Solutions (1)

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 🙂

VolkerBarth
Contributor
0 Kudos

TRIM() may have helped:)

Note, LIKE patterns are limited to 126 bytes, and longer patterns should give a -606 SQLCODE.

Answers (0)