2014-12-25 Created By BaoXinjian
一、摘要
二、案例
1. 创建测试表
-- Create table
CREATE TABLE GL.BXJ_WEBADI_DEMO ( ADI_ID NUMBER, ADI_ORGANIZATION_ID NUMBER, ADI_CODE VARCHAR2 (30), ADI_DATE DATE ); -- Create synonym
CREATE OR REPLACE PUBLIC SYNONYM BXJ_WEBADI_DEMO FOR GL.BXJ_WEBADI_DEMO; --Create sequence
CREATE SEQUENCE GL.BXJ_WEBADI_DEMO_S; CREATE OR REPLACE PUBLIC SYNONYM BXJ_WEBADI_DEMO_S FOR GL.BXJ_WEBADI_DEMO_S; -- Insert demo data
INSERT INTO BXJ_WEBADI_DEMO VALUES(1,83,'TEST01',SYSDATE); COMMIT; -- Register table and columns
BEGIN ad_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 view
CREATE OR REPLACE VIEW GL.BXJ_WEBADI_DEMO_V AS
SELECT cwd.adi_id ,cwd.adi_organization_id ,cwd.adi_code ,cwd.adi_date FROM gl.bxj_webadi_demo cwd;
2. 创建测试package
CREATE OR REPLACE PACKAGE gl.bxj_webadi_demo_pkg IS
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_pkg IS
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. 定义集成器 Integrator
Step1. 创建集成器 Create Document
Step2. 维护集成器表单功能关联
Step2. Define Layout 定义布局
Step3. 定义映射