The following lines contain the word 'select', 'insert', 'update' or 'delete':
SELECT cs.line_no, cs.text
FROM cn_source cs
WHERE cs.object_id = p_object_id
AND substr(cs.text, 1, 25) = 'CREATE OR REPLACE PACKAGE'
AND org_id = x_org_id
ORDER BY line_no;
SELECT cs.line_no, cs.text
FROM cn_source cs
WHERE cs.object_id = p_object_id
AND cs.text LIKE 'END%'
AND org_id = x_org_id
ORDER BY line_no DESC;
SELECT cs.text
FROM cn_source cs
WHERE cs.object_id = p_pks_object_id
AND cs.line_no BETWEEN p_pks_start AND (p_pks_end - 1)
AND org_id = x_org_id
ORDER BY line_no;
SELECT user
INTO l_applsys_schema
FROM dual;
insert_newlines => 'FALSE',
comp_error => x_comp_error);
cn_utils.appindcr(code, 'SELECT period_id ');
cn_utils.appindcr(code, 'SELECT period_id ');
cn_utils.appindcr(code, 'SELECT period_id ');
cn_utils.appindcr(code, 'SELECT period_id ');
cn_utils.appindcr(code, ' UPDATE cn_trx_lines ctl');
cn_utils.appindcr(code, 'trx_update_count NUMBER := 0;');
cn_utils.appindcr(code, 'trx_line_update_count NUMBER := 0;');
cn_utils.appindcr(code, 'trx_sales_line_update_count NUMBER := 0;');
cn_utils.appindcr(code, 'comm_lines_api_update_count NUMBER := 0;');
cn_utils.appindcr(code, 'x_last_updated_by NUMBER := to_number(fnd_global.user_id);');
cn_utils.appindcr(code, 'x_last_update_date DATE := sysdate;');
cn_utils.appindcr(code, 'x_last_update_login NUMBER := to_number(fnd_global.login_id);');
cn_utils.appindcr(code, ' SELECT DISTINCT adj_batch_id');
cn_utils.appindcr(code, 'trx_update_count NUMBER := 0;'); --JC 02-13-97
cn_utils.appindcr(code, 'trx_line_update_count NUMBER := 0;');
cn_utils.appindcr(code, 'trx_sales_line_update_count NUMBER := 0;');
cn_utils.appindcr(code, 'comm_lines_api_update_count NUMBER := 0;');
cn_utils.appindcr(code, 'x_last_updated_by NUMBER := to_number(fnd_global.user_id);');
cn_utils.appindcr(code, 'x_last_update_date DATE := sysdate;');
cn_utils.appindcr(code, 'x_last_update_login NUMBER := to_number(fnd_global.login_id);');
cn_utils.appindcr(code, ' SELECT DISTINCT batch_id');
cn_utils.appindcr(code, 'cn_process_audits_pkg.update_row(x_proc_audit_id, NULL, SYSDATE, SQLCODE,');
cn_collection_custom_gen.insert_cn_not_trx (
x_table_map_id => x_table_map_id,
x_event_id => x_event_id,
code => body_code,
X_ORG_ID => X_ORG_ID);
cn_collection_custom_gen.insert_comm_lines_api (x_table_map_id, x_event_id, code,X_org_id);
cn_collection_oe_gen.insert_comm_lines_api
(x_table_map_id, x_package_id, x_procedure_name, x_module_id,
x_repository_id, x_event_id, code,X_org_id);
p_location_name => 'Pre-Api-Update',
code => code,
X_ORG_ID => X_ORG_ID);
cn_collection_custom_gen.update_comm_lines_api (x_table_map_id, code,X_org_id);
cn_utils.appendcr(code, '--******** UPDATE CN_TRX CN_TRX_LINES ********-- ');
cn_utils.appindcr(code, 'cn_message_pkg.debug(''' || x_procedure_name || ': update CN_TRX and CN_TRX_LINES.''); ');
cn_utils.appindcr(code, 'fnd_file.put_line(fnd_file.Log, ''' || x_procedure_name || ': update CN_TRX and CN_TRX_LINES.''); ');
cn_utils.appindcr(code, 'UPDATE cn_trx ');
cn_utils.appindcr(code, ' WHERE trx_id IN (SELECT trx_id from cn_trx_lines ');
cn_utils.appindcr(code, 'trx_update_count := SQL%ROWCOUNT; ');
cn_utils.appindcr(code, 'cn_message_pkg.debug(''' || x_procedure_name || ': Updated '' || trx_update_count || '' records in cn_trx.''); ');
cn_utils.appindcr(code, 'fnd_file.put_line(fnd_file.Log, ''' || x_procedure_name || ': Updated '' || trx_update_count || '' records in cn_trx.''); ');
cn_utils.appindcr(code, 'UPDATE cn_trx_lines ');
cn_utils.appindcr(code, 'trx_line_update_count := SQL%ROWCOUNT; ');
cn_utils.appindcr(code, 'cn_message_pkg.debug(''' || x_procedure_name || ': Updated '' || trx_line_update_count || '' records in cn_trx_lines.''); ');
cn_utils.appindcr(code, 'fnd_file.put_line(fnd_file.Log, ''' || x_procedure_name || ': Updated '' || trx_line_update_count || '' records in cn_trx_lines.''); ');
cn_collection_ar_gen.insert_trx(x_procedure_name, x_module_id, x_event_id, code,X_org_id);
cn_collection_ar_gen.update_trx(x_procedure_name, x_module_id, x_event_id, code,X_org_id);
cn_collection_ar_gen.insert_lines(x_procedure_name, x_module_id, x_event_id, code,X_org_id);
cn_collection_ar_gen.update_invoice_total(x_procedure_name, code,l_org_id);
cn_collection_ar_gen.update_lines(x_procedure_name, x_module_id, x_event_id, code,X_org_id);
cn_collection_ar_gen.insert_sales_lines(x_procedure_name, x_module_id, x_event_id, code,X_org_id);
cn_collection_ar_gen.update_sales_lines(x_procedure_name, x_module_id, x_event_id, code,X_org_id);
cn_collection_ar_gen.insert_comm_lines (x_procedure_name, x_module_id, x_event_id, code,X_org_id);
p_location_name => 'Pre-Api-Update',
code => code,
X_ORG_ID => X_ORG_ID);
cn_collection_custom_gen.update_comm_lines_api (x_table_map_id, code,X_org_id);
SELECT mapping_type, module_id
INTO l_mapping_type, l_module_id
FROM cn_table_maps
WHERE table_map_id = x_table_map_id
AND org_id = X_ORG_ID;
(SELECT module_id, module_type, collect_flag FROM cn_modules
WHERE module_type IN ('INV','CBK','PMT','WO','RAM') AND org_id = x_org_id)
LOOP
IF rec.module_type = 'INV' THEN
l_package_name := 'cn_collect_invoices';
SELECT OBJ.name OBJECT_NAME
INTO l_package_name
FROM cn_table_map_objects tmov, cn_objects obj
WHERE tmov.table_map_id = x_table_map_id
AND tmov.tm_object_type = 'PKS'
and tmov.org_id = obj.org_id
and tmov.object_id = obj.object_id
AND tmov.org_id = X_org_id;
--dbms_output.put_line(' After Select '||l_package_name);
SELECT mapping_type, module_id
INTO l_mapping_type, l_module_id
FROM cn_table_maps
WHERE table_map_id = p_table_map_id
AND org_id = X_org_id;
(SELECT
UPPER(OBJ.name) NAME ,
MAX(DECODE(tmov.tm_object_type,'PKS',tmov.object_id,NULL)) spec_id,
MAX(DECODE(tmov.tm_object_type,'PKB',tmov.object_id,NULL)) body_id
FROM cn_table_map_objects tmov, cn_objects obj
WHERE tmov.tm_object_type IN ('PKS','PKB')
and obj.object_id = tmov.object_id
and tmov.org_id = obj.org_id
AND tmov.table_map_id = p_table_map_id
AND tmov.org_id = X_org_id
GROUP BY OBJ.name)
LOOP
--+
-- Create the Spec and Body.
--+
install_package_object(
p_object_id => rec.spec_id,
p_object_name => rec.name||l_org_append,
p_test => p_test,
x_comp_error => l_comp_error,
x_org_id => X_org_id);
(SELECT
DISTINCT UPPER(OBJ.name) NAME
FROM cn_table_map_objects tmov, cn_objects obj
WHERE tm_object_type IN ('PKS','PKB')
AND tmov.table_map_id = p_table_map_id
and tmov.object_id = obj.object_id
and tmov.org_id = obj.org_id
AND tmov.org_id = X_org_id
GROUP BY OBJ.name)
LOOP <>
FOR err_rec IN
(SELECT
'*** '||TYPE||' '||LOWER(NAME)||' LINE: '||line||'/'||position||
fnd_global.local_chr(10)||text||fnd_global.local_chr(10) outstr
FROM user_errors WHERE NAME = obj_rec.name||l_org_append||l_test_append)
LOOP <>
-- If there is enough space, append this error to the end of the
-- Errbuf, otherwise aappend as mauch as possible and then quit
-- the loop.
IF LENGTHB(x_errbuf) + LENGTHB(err_rec.outstr) <= l_max_len THEN
x_errbuf := x_errbuf || err_rec.outstr;
cn_modules_pkg.update_row(x_module_id => l_module_id,
x_module_status => 'GENERATED',
x_org_id => X_org_id);
(SELECT
DISTINCT UPPER(OBJ.name) NAME
FROM cn_table_map_objects tmov, cn_objects obj
WHERE tm_object_type IN ('PKS','PKB')
AND tmov.table_map_id = p_table_map_id
and tmov.object_id = obj.object_id
and tmov.org_id = obj.org_id
AND tmov.org_id = X_org_id
GROUP BY OBJ.name)
LOOP
IF(p_table_map_id < 0)
THEN
l_pkg_name := pkg_names.NAME||l_org_append;
(SELECT
DISTINCT UPPER(OBJ.name) NAME
FROM cn_table_map_objects tmov, cn_objects obj
WHERE tm_object_type IN ('PKS','PKB')
AND tmov.table_map_id = p_table_map_id
and tmov.object_id = obj.object_id
and tmov.org_id = obj.org_id
AND tmov.org_id = X_org_id
GROUP BY OBJ.name)
LOOP
IF(p_table_map_id < 0)
THEN
l_pkg_name := pkg_names.NAME||l_org_append;
SELECT tm.table_map_id,
tm.org_id,
tm.module_id,
mo.module_status
FROM cn_table_maps_all tm,
cn_modules_all_b mo
WHERE tm.module_id = mo.module_id
AND tm.org_id = mo.org_id
AND mo.module_status = 'GENERATED'
AND mo.org_id = nvl(p_org_id, mo.org_id)
AND mo.org_id <> -3113
ORDER BY tm.table_map_id, tm.org_id, tm.module_id;
SELECT object_name || ' ' ||
decode(object_type, 'PACKAGE BODY','compile body','PACKAGE','compile') stmt
FROM user_objects
WHERE object_name LIKE 'CN_COLLECT%'
AND substr(object_name, (INSTR(object_name,'_',1,3)+1), 1)IN ('0', '1', '2', '3', '4', '5', '6', '7', '8', '9')
AND object_type LIKE 'PACKAGE%'
AND status = 'INVALID';
SELECT object_name stmt
FROM user_objects
WHERE object_name LIKE 'CN_COLLECT%'
AND substr(object_name, (INSTR(object_name,'_',1,3)+1), 1)IN ('0', '1', '2', '3', '4', '5', '6', '7', '8', '9')
AND object_type LIKE 'PACKAGE%'
AND status = 'INVALID';