DBA Data[Home] [Help]

APPS.AML_PURGE_SALES_LEADS dependencies on AS_SALES_LEADS

Line 68: aml_debug(1,Recs_deleted(4)||l_no_of_rows_deleted||'AS_SALES_LEADS_LOG');

64: BEGIN
65: aml_Debug(1,Recs_deleted(1)||l_no_of_rows_deleted||'AS_ACCESSES_ALL');
66: aml_debug(1,Recs_deleted(2)||l_no_of_rows_deleted||'AS_CHANGED_ACCOUNTS_ALL');
67: aml_debug(1,Recs_deleted(3)||l_no_of_rows_deleted||'AML_INTERACTION_LEADS');
68: aml_debug(1,Recs_deleted(4)||l_no_of_rows_deleted||'AS_SALES_LEADS_LOG');
69: aml_debug(1,Recs_deleted(5)||l_no_of_rows_deleted||'AS_SALES_LEAD_CONTACTS');
70: aml_debug(1,Recs_deleted(6)||l_no_of_rows_deleted||'AS_SALES_LEAD_LINES');
71: -- aml_debug(1,Recs_deleted(7)||l_no_of_rows_deleted||'AS_SALES_LEAD_OPPORTUNITY');
72: aml_debug(1,Recs_deleted(8)||l_no_of_rows_deleted||'AML_MONITOR_LOG');

Line 75: aml_debug(1,Recs_deleted(11)||l_no_of_rows_deleted||'AS_SALES_LEADS');

71: -- aml_debug(1,Recs_deleted(7)||l_no_of_rows_deleted||'AS_SALES_LEAD_OPPORTUNITY');
72: aml_debug(1,Recs_deleted(8)||l_no_of_rows_deleted||'AML_MONITOR_LOG');
73: aml_debug(1,Recs_deleted(9)||l_no_of_rows_deleted||'PV_ENTITY_RULES_APPLIED');
74: aml_debug(1,Recs_deleted(10)||l_no_of_rows_deleted||'AS_TERRITORY_ACCESSES');
75: aml_debug(1,Recs_deleted(11)||l_no_of_rows_deleted||'AS_SALES_LEADS');
76: END write_count;
77:
78:
79: PROCEDURE Delete_Unqualified_Leads(P_Id_Tab IN AML_PURGE_SALES_LEADS.Sales_Lead_Id_Tab) IS

Line 102: FROM AS_SALES_LEADS_LOG

98: Recs_deleted(3) := Recs_deleted(3) + SQL%ROWCOUNT;
99:
100: FORALL I IN P_Id_Tab.FIRST..P_Id_Tab.LAST
101: DELETE
102: FROM AS_SALES_LEADS_LOG
103: WHERE Sales_Lead_Id = P_Id_Tab(I);
104: Recs_deleted(4) := Recs_deleted(4) + SQL%ROWCOUNT;
105:
106: FORALL I IN P_Id_Tab.FIRST..P_Id_Tab.LAST

Line 144: FROM AS_SALES_LEADS

140: Recs_deleted(10) := Recs_deleted(10) + SQL%ROWCOUNT;
141:
142: FORALL I IN P_Id_Tab.FIRST..P_Id_Tab.LAST
143: DELETE
144: FROM AS_SALES_LEADS
145: WHERE Sales_Lead_Id = P_Id_Tab(I);
146: Recs_deleted(11) := Recs_deleted(11) + SQL%ROWCOUNT;
147:
148: END Delete_Unqualified_Leads;

Line 176: FROM As_sales_leads

172: l_end_date date;
173:
174: CURSOR Collect_Sales_Lead_Ids(l_start_date IN date, l_end_date IN date) IS
175: SELECT Sales_Lead_Id
176: FROM As_sales_leads
177: WHERE Qualified_Flag = 'N'
178: AND TRUNC(Creation_Date) BETWEEN TRUNC(l_start_date) AND TRUNC(l_end_date)
179: AND status_code <> fnd_profile.value('AS_LEAD_LINK_STATUS')
180: AND status_code = fnd_profile.value('AS_DEFAULT_LEAD_STATUS');

Line 197: table AS_SALES_LEADS are deleted. Since the number of records to be purged will be high this is done in batch

193: aml_debug(2,'Purge Sales Leads starts');
194:
195: /* First, unqualified the leads that needs to be purged are identified and the sales lead id is taken. This is stored in
196: a Pl/Sql table. Then all the records in child tables like AS_ACCESSES_ALL, AS_SALES_LEAD_LINES and the main
197: table AS_SALES_LEADS are deleted. Since the number of records to be purged will be high this is done in batch
198: of 10000 records. The Sales Lead Ids which are stored in a Pl/Sql table are then passed to the local procedure
199: Delete_Unqualified_Leads. Since this procedure takes sales lead ids in batches of 10000,
200: for the remaining records it has be done with a simple select statement.
201:

Line 226: FROM AS_SALES_LEADS

222: --Remaining records to be deleted. So pick sales lead ids for all the remaining records and put it in
223: --a Pl/Sql table.
224: SELECT Sales_Lead_Id BULK COLLECT
225: INTO Id_Tab
226: FROM AS_SALES_LEADS
227: WHERE Qualified_Flag = 'N'
228: AND TRUNC(Creation_Date) BETWEEN TRUNC(l_start_date) AND TRUNC(l_end_date)
229: AND status_code <> fnd_profile.value('AS_LEAD_LINK_STATUS')
230: AND status_code = fnd_profile.value('AS_DEFAULT_LEAD_STATUS');