実際には、次の手順を作成しましたが、正常に機能しています。
CREATE or REPLACE PROCEDURE GET_NOS(
firstDate IN DATE,
secondDate IN DATE,
thirdDate IN DATE,
fourthDate IN DATE,
test IN VARCHAR2,
Slnt_Entity OUT TEST.RefCsr
)
AS
DemoTable CRITERIA_LIST_TABLE;
BEGIN
SELECT column1 BULK COLLECT INTO DemoTable FROM opr_test where call_date between firstDate AND secondDate AND id=test
MINUS
SELECT column1 FROM opr_test where call_date between thirdDate AND fourthDate AND id=test;
OPEN Slnt_Entity FOR SELECT * FROM TABLE(
CAST (
DemoTable AS CRITERIA_LIST_TABLE
)
) Nos;
END;
/
2.秒
create or replace TYPE "CRITERIA_LIST_TABLE" as table of varchar2(20);
/
三番
create or replace PACKAGE "TEST" AS TYPE RefCsr IS REF CURSOR; END TEST; /
今、私はこのようにクエリを変更したい
SELECT column1,column2 BULK COLLECT INTO DemoTable FROM opr_test where call_date between firstDate AND secondDate AND id=test MINUS SELECT column1,column2 FROM opr_test where call_date between thirdDate AND fourthDate AND id=test;
だから私は次のように手順を変更しました
CREATE or REPLACE PROCEDURE GET_NOS(
firstDate IN DATE,
secondDate IN DATE,
thirdDate IN DATE,
fourthDate IN DATE,
test IN VARCHAR2,
Slnt_Entity OUT TEST.RefCsr
)
AS
CURSOR c1 IS SELECT column1,column2 FROM opr_test;
create or replace TYPE "ABC" IS TABLE OF c1%ROWTYPE;
DemoTable ABC;
BEGIN
SELECT column1 BULK COLLECT INTO DemoTable FROM opr_test where call_date between firstDate AND secondDate AND id=test
MINUS
SELECT column1 FROM opr_test where call_date between thirdDate AND fourthDate AND id=test;
OPEN Slnt_Entity FOR SELECT * FROM TABLE(
CAST (
DemoTable AS CRITERIA_LIST_TABLE
)
) Nos;
END;
/
しかし、これは正しくありません。手順がどのようになるか教えてください