Thursday, February 10, 2011
How Do I Start Learning Oracle ADF and JDeveloper 11g
http://www.oracle.cc/2010/02/how-do-i-start-learning-oracle-adf-and-jdeveloper-11g/
Thursday, February 3, 2011
Wednesday, February 2, 2011
Wednesday, September 8, 2010
Exception handling for Bulk Insert and Bulk update using FORALL
DECLARE
TYPE NumList IS TABLE OF NUMBER;
-- The zeros in this list will cause divide-by-zero errors.
num_tab NumList := NumList(10,0,11,12,30,0,20,199,2,0,9,1);
errors NUMBER;
dml_errors EXCEPTION;
PRAGMA exception_init(dml_errors, -24381);
BEGIN
-- SAVE EXCEPTIONS means don't stop if some DELETEs fail.
FORALL i IN num_tab.FIRST..num_tab.LAST SAVE EXCEPTIONS
DELETE FROM emp2 WHERE salary > 500000/num_tab(i);
-- If any errors occurred during the FORALL SAVE EXCEPTIONS,
-- a single exception is raised when the statement completes.
EXCEPTION
WHEN dml_errors THEN -- Now we figure out what failed and why.
errors := SQL%BULK_EXCEPTIONS.COUNT;
dbms_output.put_line('Number of DELETE statements that failed: ' || errors);
FOR i IN 1..errors LOOP
dbms_output.put_line('Error #' || i || ' occurred during '||
'iteration #' || SQL%BULK_EXCEPTIONS(i).ERROR_INDEX);
dbms_output.put_line('Error message is ' ||
SQLERRM(-SQL%BULK_EXCEPTIONS(i).ERROR_CODE));
END LOOP;
END;
TYPE NumList IS TABLE OF NUMBER;
-- The zeros in this list will cause divide-by-zero errors.
num_tab NumList := NumList(10,0,11,12,30,0,20,199,2,0,9,1);
errors NUMBER;
dml_errors EXCEPTION;
PRAGMA exception_init(dml_errors, -24381);
BEGIN
-- SAVE EXCEPTIONS means don't stop if some DELETEs fail.
FORALL i IN num_tab.FIRST..num_tab.LAST SAVE EXCEPTIONS
DELETE FROM emp2 WHERE salary > 500000/num_tab(i);
-- If any errors occurred during the FORALL SAVE EXCEPTIONS,
-- a single exception is raised when the statement completes.
EXCEPTION
WHEN dml_errors THEN -- Now we figure out what failed and why.
errors := SQL%BULK_EXCEPTIONS.COUNT;
dbms_output.put_line('Number of DELETE statements that failed: ' || errors);
FOR i IN 1..errors LOOP
dbms_output.put_line('Error #' || i || ' occurred during '||
'iteration #' || SQL%BULK_EXCEPTIONS(i).ERROR_INDEX);
dbms_output.put_line('Error message is ' ||
SQLERRM(-SQL%BULK_EXCEPTIONS(i).ERROR_CODE));
END LOOP;
END;
Thursday, July 29, 2010
FNDLOAD for Profile
DOWNLOAD
=========
FNDLOAD apps/appspwd O Y DOWNLOAD $FND_TOP/patch/115/import/afscprof.lct filename.ldt PROFILE PROFILE_NAME="profile name" APPLICATION_SHORT_NAME="XXDIS"
UPLOAD
=======
FNDLOAD apps/appspwd O Y UPLOAD $FND_TOP/patch/115/import/afscprof.lct filename.ldt
=========
FNDLOAD apps/appspwd O Y DOWNLOAD $FND_TOP/patch/115/import/afscprof.lct filename.ldt PROFILE PROFILE_NAME="profile name" APPLICATION_SHORT_NAME="XXDIS"
UPLOAD
=======
FNDLOAD apps/appspwd O Y UPLOAD $FND_TOP/patch/115/import/afscprof.lct filename.ldt
Wednesday, July 28, 2010
FNDLOAD script for value set with values
DOWNLOAD
=========
FNDLOAD apps/appspwd O Y DOWNLOAD $FND_TOP/patch/115/import/afffload.lct filename.ldt VALUE_SET FLEX_VALUE_SET_NAME="valueset name"
UPLOAD
======
FNDLOAD apps/appsdev 0 Y UPLOAD $FND_TOP/patch/115/import/afffload.lct filename.ldt
=========
FNDLOAD apps/appspwd O Y DOWNLOAD $FND_TOP/patch/115/import/afffload.lct filename.ldt VALUE_SET FLEX_VALUE_SET_NAME="valueset name"
UPLOAD
======
FNDLOAD apps/appsdev 0 Y UPLOAD $FND_TOP/patch/115/import/afffload.lct filename.ldt
Thursday, June 24, 2010
PLSQL block with bulk collect and limit
DECLARE
CURSOR get_item_det_cur (
p_in_num_from_itemid IN NUMBER,
p_in_num_to_itemid IN NUMBER
)
IS
SELECT msib.inventory_item_id, msib.organization_id
FROM mtl_system_items_b msib
WHERE msib.segment2 = msib.attribute5
AND msib.organization_id = 81
AND msib.inventory_item_id BETWEEN p_in_num_from_itemid
AND p_in_num_to_itemid;
TYPE item_det_tbl IS TABLE OF get_item_det_cur%ROWTYPE
INDEX BY BINARY_INTEGER;
l_item_det_tbl item_det_tbl;
l_item_id NUMBER;
l_org_id NUMBER;
l_cnt NUMBER := 0;
BEGIN
OPEN get_item_det_cur (1174281, 1174500);
LOOP
l_cnt := l_cnt + 1;
DBMS_OUTPUT.put_line ('l_cnt==>' || l_cnt);
FETCH get_item_det_cur
BULK COLLECT INTO l_item_det_tbl LIMIT 10;
FOR idx IN l_item_det_tbl.FIRST .. l_item_det_tbl.LAST
LOOP
l_item_id := l_item_det_tbl (idx).inventory_item_id;
l_org_id := l_item_det_tbl (idx).organization_id;
DBMS_OUTPUT.put_line ('l_item_id==>' || l_item_id);
DBMS_OUTPUT.put_line ('l_org_id==>' || l_org_id);
END LOOP;
END LOOP;
CLOSE get_item_det_cur;
END;
CURSOR get_item_det_cur (
p_in_num_from_itemid IN NUMBER,
p_in_num_to_itemid IN NUMBER
)
IS
SELECT msib.inventory_item_id, msib.organization_id
FROM mtl_system_items_b msib
WHERE msib.segment2 = msib.attribute5
AND msib.organization_id = 81
AND msib.inventory_item_id BETWEEN p_in_num_from_itemid
AND p_in_num_to_itemid;
TYPE item_det_tbl IS TABLE OF get_item_det_cur%ROWTYPE
INDEX BY BINARY_INTEGER;
l_item_det_tbl item_det_tbl;
l_item_id NUMBER;
l_org_id NUMBER;
l_cnt NUMBER := 0;
BEGIN
OPEN get_item_det_cur (1174281, 1174500);
LOOP
l_cnt := l_cnt + 1;
DBMS_OUTPUT.put_line ('l_cnt==>' || l_cnt);
FETCH get_item_det_cur
BULK COLLECT INTO l_item_det_tbl LIMIT 10;
FOR idx IN l_item_det_tbl.FIRST .. l_item_det_tbl.LAST
LOOP
l_item_id := l_item_det_tbl (idx).inventory_item_id;
l_org_id := l_item_det_tbl (idx).organization_id;
DBMS_OUTPUT.put_line ('l_item_id==>' || l_item_id);
DBMS_OUTPUT.put_line ('l_org_id==>' || l_org_id);
END LOOP;
END LOOP;
CLOSE get_item_det_cur;
END;
Subscribe to:
Posts (Atom)