在以下“AND CAST(FLAGS AS BIGINT) & 1 = 1”如何为 Oracle sp 编写此代码时,我们必须允许应用程序也处理 Oracle 用户。
ALTER PROCEDURE [OGEN].[DBD_GET_STOCK_SUMMARY]
@FACILITY_KEY VARCHAR(1000),
@START_DATE DATETIME,
@END_DATE DATETIME
AS
BEGIN
SELECT COUNT(*) COUNT, OGEN.DATEONLY(CREATED_ON) [DATE]
FROM OGEN.NDC_M_FORMULARY
WHERE OGEN.DATEONLY(CREATED_ON) BETWEEN OGEN.DATEONLY(@START_DATE) AND OGEN.DATEONLY(@END_DATE)
AND FACILITY_KEY IN (SELECT VALUE FROM OGEN.COMMA_TO_TABLE(@FACILITY_KEY))
**AND CAST(FLAGS AS BIGINT) & 1 = 1**
GROUP BY OGEN.DATEONLY(CREATED_ON)
END
GO