在“AND CAST(FLAGS AS BIGINT)& 1 = 1”中如何为Oracle sp写这个,我们必须允许app处理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
答案 0 :(得分:0)
而不是BIGINT
,您可以通过以下方式在oracle中使用NUMBER
或BINARY_INTEGER
...
CAST (FLAGS AS NUMBER(19))
答案 1 :(得分:0)
select count(*) count, trunc(CREATED_ON) "DATE"
from NDC_M_FORMULARY
where trunc(CREATED_ON) BETWEEN trunc(:startDate) AND trunc(:endDate)
and FACILITY_KEY IN (select cast (regexp_substr(:facilityKey,'[^,]+', 1, level) as number)
from dual
connect by regexp_substr(:facilityKey, '[^,]+', 1, level) is not null)
and bitand(cast (flags as int), 1) = 1
group by trunc(CREATED_ON)