首页 > 代码库 > WebADI_建立WebADI标准过程(案例)

WebADI_建立WebADI标准过程(案例)

 

1. 创建测试表

-- Create tableCREATE TABLE GL.BXJ_WEBADI_DEMO(   ADI_ID                NUMBER,   ADI_ORGANIZATION_ID   NUMBER,   ADI_CODE              VARCHAR2 (30),   ADI_DATE              DATE);-- Create synonymCREATE OR REPLACE PUBLIC SYNONYM BXJ_WEBADI_DEMO FOR GL.BXJ_WEBADI_DEMO;--Create sequenceCREATE SEQUENCE GL.BXJ_WEBADI_DEMO_S;CREATE OR REPLACE PUBLIC SYNONYM BXJ_WEBADI_DEMO_S FOR GL.BXJ_WEBADI_DEMO_S;-- Insert demo dataINSERT INTO BXJ_WEBADI_DEMO VALUES(1,83,TEST01,SYSDATE);COMMIT;-- Register table and columnsBEGINad_dd.register_table(SQLGL,bxj_webadi_demo,t);ad_dd.register_column(SQLGL,bxj_webadi_demo,adi_id,1,number,38,y,n);ad_dd.register_column(SQLGL,bxj_webadi_demo,adi_organization_id,2,number,38,y,n);ad_dd.register_column(SQLGL,bxj_webadi_demo,adi_code,3,varchar2,30,y,n);ad_dd.register_column(SQLGL,bxj_webadi_demo,adi_date,4,date,9,y,n);COMMIT;END;-- Create demo viewCREATE OR REPLACE VIEW GL.BXJ_WEBADI_DEMO_V ASSELECT cwd.adi_id,cwd.adi_organization_id,cwd.adi_code,cwd.adi_dateFROM gl.bxj_webadi_demo cwd;

 

 

2. 创建测试package

 

CREATE OR REPLACE PACKAGE gl.bxj_webadi_demo_pkgIS   PROCEDURE upload_data (p_id                IN NUMBER,                          p_organization_id      NUMBER,                          p_code              IN VARCHAR2,                          p_date              IN DATE);END bxj_webadi_demo_pkg;/

 

 

CREATE OR REPLACE PACKAGE BODY gl.bxj_webadi_demo_pkgIS   PROCEDURE upload_data (p_id                IN NUMBER,                          p_organization_id      NUMBER,                          p_code              IN VARCHAR2,                          p_date              IN DATE)   IS   BEGIN      IF p_id IS NULL      THEN         INSERT INTO bxj_webadi_demo (adi_id,                                      adi_organization_id,                                      adi_code,                                      adi_date)            SELECT   bxj_webadi_demo_s.NEXTVAL,                     p_organization_id,                     p_code,                     p_date              FROM   DUAL;      ELSE         UPDATE   bxj_webadi_demo cwd            SET   cwd.adi_organization_id = p_organization_id,                  cwd.adi_code = p_code,                  cwd.adi_date = p_date          WHERE   cwd.adi_id = p_id;      END IF;      COMMIT;   END;END bxj_webadi_demo_pkg;/

 

 

3.

 

Step1. Create Document

技术分享

 

WebADI_建立WebADI标准过程(案例)