首页 > 代码库 > 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标准过程(案例)
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。