I'll see what I can do about creating a small sample. Part of the issue is that I think it might just have something to do with the large number of fields on both business objects. Here's the stack trace for this error:
[DB2Exception (0x80004005): ERROR [42601] [IBM][DB2/6000] SQL0104N An unexpected token ")" was found following ""SW_ORDER_SCHED" WHE". Expected tokens may include: "END-OF-STATEMENT". SQLSTATE=42601
]
IBM.Data.DB2.DB2Command.a(CommandBehavior A_0, String A_1, DB2CursorType A_2, Boolean A_3, Boolean A_4, Boolean A_5, Int32 A_6) +3973
IBM.Data.DB2.DB2Command.a(CommandBehavior A_0, String A_1) +47
IBM.Data.DB2.DB2Command.ExecuteReader(CommandBehavior behavior) +93
IBM.Data.DB2.DB2Command.ExecuteDbDataReader(CommandBehavior behavior) +33
System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior) +7
System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +141
System.Data.Common.DbDataAdapter.Fill(DataTable[] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior) +162
System.Data.Common.DbDataAdapter.Fill(DataTable dataTable) +107
MicroFour.StrataFrame.Data.DbDataSourceItem.GetDataTable(DbCommand Command, OnChangeEventHandler CallBack) +139
MicroFour.StrataFrame.Data.DbDataSourceItem.GetDataTable(QueryInformation QueryInfo, OnChangeEventHandler CallBack) +56
MicroFour.StrataFrame.Data.DataLayer.GetDataTable(QueryInformation QueryInfo, Boolean RegisterNotification) +152
MicroFour.StrataFrame.Business.BusinessLayer.FillOrGetByParentPrimaryKey(Object[] ParentPrimaryKeys, Boolean ReplaceCurrentDataTable) +546
MicroFour.StrataFrame.Business.BusinessLayer.FillOrGetByParent(BusinessLayer Parent, Boolean ReplaceCurrentTable) +470
MicroFour.StrataFrame.Business.BusinessLayer.FillByParent(BusinessLayer Parent) +33
Payless.Sourcing.BPM.PurchaseOrders.Schedule.mnuVendor_SelectedIndexChanged(Object sender, EventArgs e) in I:\PSS Design\Visual Studio\BPM\Business Partner Module\PO\Schedule.aspx.cs:190
System.Web.UI.WebControls.ListControl.OnSelectedIndexChanged(EventArgs e) +105
System.Web.UI.WebControls.DropDownList.RaisePostDataChangedEvent() +134
System.Web.UI.WebControls.DropDownList.System.Web.UI.IPostBackDataHandler.RaisePostDataChangedEvent() +7
System.Web.UI.Page.RaiseChangedEvents() +117
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1646
I don't know why, but it just suddenly cuts off the SQL its generating (see the PO.html file attached to my original post) -- either that or it generates everything, but doesn't send it. I'm on SF 1.6.1 (with a slew of fixes from some issues I ran into last Fall). I'm using the DB2 9.0.0.2 provider and the database itself is DB2 UDB v8 (hosted on an AIX platform).
I've got a way I can work around the problem, but it means I have to make a DB call each time I navigate to a new record in the Purchase Orders business object. Causes the load time to be quite a bit slower than I'd like. I'm going to try out a couple other options, but the SQL the provider is sending to DB2 doesn't seem to match with what I would think would be generated.
Again, I'll see if I can come up with a simplified sample.