[步骤]
content:[18:02:11] -------------------------------------------------------------CODE:N1802113
Error:15_134_1_-2146232060
SQL:
SELECT Count(1) FROM dbo.RB_OrderInfo oi (NOLOCK)
INNER JOIN RB_OrderInfo_BeikuExpand ep (NOLOCK)
ON oi.CustomerID = ep.CustomerID
AND oi.OrderCode = ep.OrderCode
LEFT OUTER JOIN RB_OrderSource (NOLOCK) os
ON oi.OrderSourceID = os.ID
AND oi.CustomerID = os.CustomerID
LEFT OUTER JOIN RB_Transport (NOLOCK) ts
ON oi.TransportID = ts.ID
AND oi.CustomerID = ts.CustomerID
LEFT JOIN dbo.RB_WareHouse (NOLOCK) wh
ON oi.CustomerID = wh.CustomerID
AND oi.WareHouseID = wh.ID
LEFT JOIN dbo.RB_WareHouse (NOLOCK) towh
ON oi.CustomerID = towh.CustomerID
AND oi.ToWareHouseID = towh.ID
LEFT JOIN RB_OrderInfo_Beiku (NOLOCK) beiku
ON beiku.CustomerID = oi.CustomerID
AND beiku.OrderCode = oi.OrderCode
LEFT JOIN RB_OrderInfo_BeikuExpand (NOLOCK) epo ON epo.TransitOrderCode=oi.OrderCode AND epo.CustomerID=oi.CustomerID
LEFT JOIN RB_RestockOrder_ApprovalExecutor(NOLOCK) ae ON ae.CustomerId = oi.CustomerID AND ae.OrderCode = oi.OrderCode
LEFT JOIN RB_FBA_ShipmentInfo(NOLOCK) fbasi ON oi.CustomerID =fbasi.CustomerID AND fbasi.OrderSourceID = oi.OrderSourceID AND oi.AmazonShipmentId=fbasi.ShipmentId
LEFT JOIN RB_Admin rba WITH(nolock) ON rba.CustomerID = os.CustomerID AND rba.ID = os.SaleAdminID
LEFT JOIN RB_BusinessTeam bt WITH(nolock) ON bt.CustomerID = os.CustomerID AND bt.ID = rba.BusinessTeamID
LEFT JOIN RB_Admin frba WITH(nolock) ON frba.CustomerID = os.CustomerID AND frba.ID = os.FBASaleAdminID
LEFT JOIN RB_BusinessTeam fbt WITH(nolock) ON fbt.CustomerID = frba.CustomerID AND fbt.ID = frba.BusinessTeamID
LEFT JOIN RB_STA_InboundShipment(NOLOCK) sta ON sta.InboundPlanId=ep.InboundPlanId AND ep.CustomerID=sta.CustomerID
WHERE oi.CustomerID = @CustomerID
AND oi.IsStockOrder = 1 AND os.OrderSourceType = 1 AND towh.WareHouseType = 3 AND ep.OrderBuildType=1 AND oi.IsSystem = 0 AND EXISTS
(
SELECT 1
FROM RB_OrderSource_SaleAdmin osa (NOLOCK)
WHERE osa.OrderSourceID = os.ID
AND osa.CustomerID = 1
AND osa.AdminID = 9856
) AND oi.OrderCode IN (SELECT oi.OrderCode
FROM dbo.RB_OrderInfo (NOLOCK) oi
LEFT JOIN dbo.RB_OrderList ol WITH (NOLOCK)
ON ol.CustomerID = oi.CustomerID
AND ol.OrderCode = oi.OrderCode
WHERE oi.CustomerID = @CustomerID
AND oi.IsStockOrder = 1
AND LTRIM(RTRIM(ol.ASIN)) = @Asin
AND oi.AddTime >= @subStartTime
) AND oi.ServiceAdminID IN (SELECT CAST(item AS INT) FROM dbo.CharSplitForIn(@ServiceAdminIdStr,',')) AND oi.AddTime >=@StartTime AND oi.AddTime<=@EndTime AND oi.OrderCode IN (SELECT DISTINCT oii.OrderCode
FROM dbo.RB_OrderInfo (NOLOCK) oii
LEFT JOIN dbo.RB_OrderList oll WITH (NOLOCK)
ON oll.CustomerID = oii.CustomerID
AND oll.OrderCode = oii.OrderCode
WHERE oii.CustomerID = @CustomerID
AND oii.IsStockOrder = 1
AND LTRIM(RTRIM(oll.ASIN)) in (SELECT item FROM dbo.CharSplitForIn(@KeyWordStr,','))
AND oll.AddTime >= @subStartTime
) option(recompile,maxdop 16)
PARAMS:@CustomerID = 1 ,@subStartTime = 2024/8/1 0:00:00 ,@Asin = B0DK25VP1M ,@ServiceAdminIdStr = 9856 ,@StartTime = 2024/8/1 0:00:00 ,@EndTime = 2024/12/2 23:59:59 ,@subStartTime = 2024/8/1 0:00:00 ,@KeyWordStr = B0CHFT6T5P,B0CHFSDN1F,B0CHFSPRBX ,
MESSAGE:The variable name '@subStartTime' has already been declared. Variable names must be unique within a query batch or stored procedure.
Must declare the scalar variable "@KeyWordStr".
TRACE: 在 System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
在 System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
在 System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
在 System.Data.SqlClient.SqlDataReader.TryConsumeMetaData()
在 System.Data.SqlClient.SqlDataReader.get_MetaData()
在 System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString, Boolean isInternal, Boolean forDescribeParameterEncryption, Boolean shouldCacheForAlwaysEncrypted)
在 System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, Boolean inRetry, SqlDataReader ds, Boolean describeParameterEncryptionRequest)
在 System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry)
在 System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
在 System.Data.SqlClient.SqlCommand.ExecuteScalar()
在 RB.DAL.DBOperator.GetSingle(String SQLString, SqlCommand cmd, Int32 Times, SqlParameter[] cmdParms, Boolean IsWriteDB) 在 RB.DAL.DBOperator.toCommonTipException(SqlException ex, String sql, SqlParameter[] cmdParms)
在 RB.DAL.DBOperator.GetSingle(String SQLString, SqlCommand cmd, Int32 Times, SqlParameter[] cmdParms, Boolean IsWriteDB)
在 RB.DALExtendV2.RB_OrderInfoExtendV2.GetModelListForReStock(CM_FBAShippingScheduleListParam param, Int32& recordCount)
在 PandaBuy.ERP.Web.IrobotBox.Restock.FBA.FBAShippingScheduleList.Page_Load(Object sender, EventArgs e)
在 System.Web.UI.Control.OnLoad(EventArgs e)
在 System.Web.UI.Control.LoadRecursive()
在 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
在 System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
在 System.Web.UI.Page.ProcessRequest()
在 System.Web.UI.Page.ProcessRequest(HttpContext context)
在 ASP.irobotbox_restock_fba_fbashippingschedulelist_aspx.ProcessRequest(HttpContext context)
在 System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
在 System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step)
在 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
在 System.Web.HttpApplication.PipelineStepManager.ResumeSteps(Exception error)
在 System.Web.HttpApplication.BeginProcessRequestNotification(HttpContext context, AsyncCallback cb)
在 System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context)
在 System.Web.Hosting.PipelineRuntime.ProcessRequestNotificationHelper(IntPtr rootedObjectsPointer, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags)
在 System.Web.Hosting.PipelineRuntime.ProcessRequestNotification(IntPtr rootedObjectsPointer, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags)
在 System.Web.Hosting.UnsafeIISMethods.MgdIndicateCompletion(IntPtr pHandler, RequestNotificationStatus& notificationStatus)
在 System.Web.Hosting.UnsafeIISMethods.MgdIndicateCompletion(IntPtr pHandler, RequestNotificationStatus& notificationStatus)
在 System.Web.Hosting.PipelineRuntime.ProcessRequestNotificationHelper(IntPtr rootedObjectsPointer, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags)
在 System.Web.Hosting.PipelineRuntime.ProcessRequestNotification(IntPtr rootedObjectsPointer, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags)
[结果]
[期望]
修复 异常