CREATE TABLE LIHUAN.BILL_POINTS ( POINTS_ID NUMBER(10,0) NOT NULL, CUSTOMER_ID NUMBER(10,0) NOT NULL, BILL_POINT_NO NUMBER(2,0) DEFAULT 1 NOT NULL, CONSTRAINT PK_BILL_POINTS PRIMARY KEY (POINTS_ID) ) /
其次,建PACKAGE
CREATE OR REPLACE PACKAGE LIHUAN.YY_PKG_BILL_POINT_NO/*取得用户的所有计费电序号*/ IS TYPE T_CURSOR IS REF CURSOR; PROCEDURE BILL_POINT_NO(P_CUSTOMER_ID BILL_POINTS.CUSTOMER_ID%TYPE, Re_CURSOR OUT T_CURSOR); END; /
再次,建PACKAGE BODY
CREATE OR REPLACE PACKAGE BODY LIHUAN.YY_PKG_BILL_POINT_NO/*取得用户的所有计费电序号*/ IS PROCEDURE BILL_POINT_NO(P_CUSTOMER_ID BILL_POINTS.CUSTOMER_ID%TYPE, Re_CURSOR OUT T_CURSOR) IS V_CURSOR T_CURSOR; BEGIN OPEN V_CURSOR FOR select Bill_Point_No from BILL_POINTS where CUSTOMER_ID =P_CUSTOMER_ID; Re_CURSOR := V_CURSOR; END; END; /