SP_Cust_PDA_GetBarCodeState.sql 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. -- ================================================
  2. -- Template generated from Template Explorer using:
  3. -- Create Procedure (New Menu).SQL
  4. --
  5. -- Use the Specify Values for Template Parameters
  6. -- command (Ctrl-Shift-M) to fill in the parameter
  7. -- values below.
  8. --
  9. -- This block of comments will not be included in
  10. -- the definition of the procedure.
  11. -- ================================================
  12. SET ANSI_NULLS ON
  13. GO
  14. SET QUOTED_IDENTIFIER ON
  15. GO
  16. -- =============================================
  17. -- Author: ²Ü¼Î½Ü
  18. -- Create date: 2022/8/11
  19. -- Description: ·Ö°ü²éѯ
  20. -- =============================================
  21. IF (EXISTS (SELECT * FROM SYS.OBJECTS WHERE NAME = 'SP_Cust_PDA_GetBarCodeState'))
  22. DROP PROC SP_Cust_PDA_GetBarCodeState
  23. GO
  24. CREATE PROCEDURE SP_Cust_PDA_GetBarCodeState
  25. -- Add the parameters for the stored procedure here
  26. @BarCode NVARCHAR(500),
  27. @OrgCode NVARCHAR(50)
  28. AS
  29. BEGIN
  30. -- SET NOCOUNT ON added to prevent extra result sets from
  31. -- interfering with SELECT statements.
  32. SET NOCOUNT ON;
  33. -- Insert statements for procedure here
  34. DECLARE @OrgID AS BIGINT
  35. SELECT @OrgID = ID FROM Base_Organization WHERE Code = @OrgCode
  36. SELECT Code, State, WhQty, BarCodeType, Qty
  37. FROM BC_BarCode
  38. WHERE Code = @BarCode
  39. -- AND Org = @OrgID
  40. AND BarCodeType = 3
  41. END
  42. GO
  43. -- EXEC SP_Cust_PDA_GetBarCodeState @BarCode = '000168GDCL-22050000', @OrgCode = '168'