Skip to Content
0
Former Member
Jan 05, 2011 at 10:47 AM

Select query problem in JDBC sender adapter

27 Views

Hello Experts,

We have a problem with PI sender adapter that PI has started to miss records in database some database records are missing and we are using the below selet query :

SELECT * FROM [database name].[dbo].[Material_Movement] WHERE [Process_Order_Number] = (Select TOP 1 [Process_Order_Number] FROM [database name].[dbo].[Material_Movement] WHERE ([PI_Read_Date] IS NULL AND [Movement_Type] = (SELECT TOP 1 [Movement_Type] FROM [database name].[dbo].[Material_Movement] WHERE [Transaction_Code] = 'xyz' AND [PI_Read_Date] IS NULL ORDER BY Created_Date ASC))) AND [Transaction_Code] = 'xyz' AND [Movement_Type] = (SELECT TOP 1 [Movement_Type] FROM [database name].[dbo].[Material_Movement] WHERE [Transaction_Code] = 'xyz' AND [PI_Read_Date] IS NULL ORDER BY Created_Date ASC) AND [PI_Read_Date] IS NULL ORDER BY [Transaction_ID] ASC

I am weak in select query could you please check and suggest how the query can be modified to avoid this issue .

Thanks,

Somenath