https://blogs.oracle.com/stevenChan/entry/new_whitepaper_on_web_applications
I have tried to create a view tutorial of end to end development with running webadi
Quick Code
Run from BNE Schema: (Code highlighted is important, these has to be not null, as this will be used to return error message back using importer)
Create table "BNE"."BNE_TEST_IMPR_INTERFACE"
(
"APPLICATION_ID" NUMBER(15,0) NOT NULL ENABLE,
"VIEWER_CODE" VARCHAR2(30 BYTE) NOT NULL ENABLE,
"RUN_ID" NUMBER(15,0) NOT NULL ENABLE,
"USER_NAME" VARCHAR2(240 BYTE) NOT NULL ENABLE,
"CREATED_BY" NUMBER(15,0) NOT NULL ENABLE,
"CREATION_DATE" DATE NOT NULL ENABLE,
"LAST_UPDATED_BY" NUMBER(15,0) NOT NULL ENABLE,
"LAST_UPDATE_LOGIN" NUMBER(15,0),
"LAST_UPDATE_DATE" DATE NOT NULL ENABLE,
"ENABLED_FLAG" VARCHAR2(1 BYTE),
"RESULT" VARCHAR2(5 BYTE),
"MESSAGE" VARCHAR2(50 BYTE)
);
Grant all on BNE.BNE_TEST_IMPR_INTERFACE to APPS;
CREATE SEQUENCE "BNE_TEST_IMPORTER_S" MINVALUE 10000 MAXVALUE 2147483647 INCREMENT BY 1 START WITH 10000 CACHE 1000 NOORDER NOCYCLE ;
Grant all on BNE_TEST_IMPORTER_S to APPS;
run from apps:
select * from BNE_TEST_IMPR_INTERFACE;
Begin
AD_DD.REGISTER_TABLE ('BNE','BNE_TEST_IMPR_INTERFACE','T');
ad_dd.register_column ('BNE', 'BNE_TEST_IMPR_INTERFACE','APPLICATION_ID',5,'NUMBER',22,'N', 'N' );
ad_dd.register_column ('BNE', 'BNE_TEST_IMPR_INTERFACE','VIEWER_CODE',10,'VARCHAR2',30,'N', 'N' );
ad_dd.register_column ('BNE', 'BNE_TEST_IMPR_INTERFACE' ,'RUN_ID',15,'NUMBER',22,'N', 'N' );
ad_dd.register_column ('BNE', 'BNE_TEST_IMPR_INTERFACE' ,'USER_NAME',20,'VARCHAR2',240,'N', 'N' );
ad_dd.register_column ('BNE', 'BNE_TEST_IMPR_INTERFACE' ,'CREATED_BY',25,'NUMBER',22,'N', 'N' );
ad_dd.register_column ('BNE', 'BNE_TEST_IMPR_INTERFACE' ,'CREATION_DATE',30,'DATE',7,'N', 'N' );
ad_dd.register_column ('BNE', 'BNE_TEST_IMPR_INTERFACE' ,'LAST_UPDATED_BY',35,'NUMBER',22,'N', 'N' );
ad_dd.register_column ('BNE', 'BNE_TEST_IMPR_INTERFACE' ,'LAST_UPDATE_LOGIN',40,'NUMBER',22,'Y', 'N' );
ad_dd.register_column ('BNE', 'BNE_TEST_IMPR_INTERFACE' ,'LAST_UPDATE_DATE',45,'DATE',7,'N', 'N' );
ad_dd.register_column ('BNE', 'BNE_TEST_IMPR_INTERFACE' ,'ENABLED_FLAG',50,'VARCHAR2',1,'Y', 'N' );
ad_dd.register_column ('BNE', 'BNE_TEST_IMPR_INTERFACE' ,'RESULT',55,'VARCHAR2',5,'Y', 'N' );
ad_dd.register_column ('BNE', 'BNE_TEST_IMPR_INTERFACE' ,'MESSAGE',60,'VARCHAR2',50,'Y', 'N' );
End;
/
create synonym BNE_TEST_IMPORTER_S for bne.BNE_TEST_IMPORTER_S;
create synonym BNE_TEST_IMPR_INTERFACE for bne.BNE_TEST_IMPR_INTERFACE;
--BEGIN
--AD_DD.DELETE_COLUMN('BNE','XX_DTV_CONTENT_TAB','ITEM_TEXT');
--AD_DD.REGISTER_COLUMN ('BNE', 'XX_DTV_CONTENT_TAB','ITEM_TEXT', 10, 'VARCHAR2',100,'Y', 'N');
--END;
COMMIT;
CREATE OR REPLACE PACKAGE BNE_TEST_IMPORTER_PKG
AS
PROCEDURE import_test (p_run_id IN NUMBER, p_error_rows_mod IN NUMBER);
END;
/
CREATE OR REPLACE PACKAGE BODY BNE_TEST_IMPORTER_PKG
AS
PROCEDURE import_test (p_run_id IN NUMBER, p_error_rows_mod IN NUMBER)
IS
CURSOR cur_recs_interface
IS
SELECT run_id,
application_id,
viewer_code,
result,
MESSAGE
FROM BNE_TEST_IMPR_INTERFACE
WHERE run_id = p_run_id
FOR UPDATE OF result, MESSAGE;
rec cur_recs_interface%ROWTYPE;
i NUMBER := 0;
errCount NUMBER := 1;
ERROR_CODE VARCHAR2 (5);
BEGIN
FOR rec IN cur_recs_interface
LOOP
IF MOD (i, p_error_rows_mod) = 0
THEN
ERROR_CODE := 'ERR' || errCount;
errCount := errCount + 1;
errCount := MOD (errCount, 6);
IF (errCount = 0)
THEN
errCount := 1;
END IF;
UPDATE BNE_TEST_IMPR_INTERFACE
SET result = ERROR_CODE,
MESSAGE = 'Viewer error for ' || rec.viewer_code
WHERE CURRENT OF cur_recs_interface;
ELSE
UPDATE BNE_TEST_IMPR_INTERFACE
SET result = 'SUCC',
MESSAGE = 'Viewer Success for ' || rec.viewer_code
WHERE CURRENT OF cur_recs_interface;
END IF;
i := i + 1;
END LOOP;
END import_test;
END BNE_TEST_IMPORTER_PKG;
/
Hi Gaurav,
ReplyDeleteDepending value set is working fine, but when we select value then value is not reflecting in webadi excel. please help
is this relavent question here, not sure?
ReplyDelete