After learning about different Date-Effective update modes available in ADF 11g and their behavior, now let us move to date-effective delete modes. Understanding and using different DE delete modes also little tricky. Please go through below explanation of different DE delete modes along with examples.
All the date-effective delete modes are defined as constants in oracle.job.Row class as any kind of effective dated operation is performed on a row itself. Before going into details, let us take an example to explain the concepts. For example, we'll take the same example of 'Job' date-effective object and explain different date-effective delete modes available. Sample application having the required code to perform the DE delete operations can be downloaded from here.
The following DE delete modes available in Jdeveloper 11g:
1.EFFDT_DELETE_NEXT_CHANGE_MODE: When an effective dated row is deleted in "delete next change" mode, the end date of the row is set to the end date of adjoining row and the adjoining row is deleted.
For example, if the Job with JobId 100000020529001 has the following date-effective rows,
And, if the current row is [100000020529001,01-Jan-2011,31-Dec-2012] (or if the current effective date falls in the range of 01-Jan-1900 and 31-Dec-2012) and if we want to delete the next date-effective row i.e., [100000020529001,01-Jan-2013,31-Dec-4712], we'll use EFFDT_DELETE_NEXT_CHANGE_MODE.
After deleting the row in EFFDT_DELETE_NEXT_CHANGE_MODE, the resultant rows will be:
2. EFFDT_DELETE_THIS_CHANGE_MODE: When an effective dated row is deleted in "delete this change" mode, the current row is removed.
For example, let us continue with the same above 3 rows and if we want to delete the Job Row [100000020529001,01-Jan-1950,31-Dec-2010], we need to make this row as current row (i.e., the effective date will be between 1-Jan-1950 and 31-Dec-2010) and delete the row in EFFDT_DELETE_THIS_CHANGE_MODE.
After deleting the current row in EFFDT_DELETE_THIS_CHANGE_MODE, the resultant rows will be:
3.EFFDT_DELETE_MODE: When an effective dated row is deleted in "delete" mode, the end date of the row is set to the row's effective date and all the future rows for the same key values are deleted.
For example, let us assume that we have the following 4 date effective rows for the job with JobId 100000020529001
And, if we want to end date the 2nd row i.e., [100000020529001,01-Jan-1950,31-Dec-1974] at 01-Jan-1960 and want to delete all the future rows, we'll pass the effective date 01-Jan-1960 and use the mode EFFDT_DELETE_MODE.
After deleting the rows in EFFDT_DELETE_MODE mode, the resultant rows will be:
4.EFFDT_DELETE_FUTURE_CHANGE_MODE: When an effective dated row is deleted in "delete future change" mode, the end date of the row is set to the end of time and all the future rows for the same key values are deleted.
For example, let us assume that we have the following 4 date effective rows for the job with JobId 100000020529001
And, if we want to delete all future date-effective rows starting from 01-Jan-1975, then, we need to make the row [100000020529001,01-Jan-1950,31-Dec-1974] as current row (or make effective date between 01-Jan-1950 and 31-Dec-1974) and delete the rows in EFFDT_DELETE_FUTURE_CHANGE_MODE. This will delete all remaining future rows and end date the current row i.e., [100000020529001,01-Jan-1950,31-Dec-1974] till EOT(31-12-4712).
The resultant rows after deleting the rows in EFFDT_DELETE_FUTURE_CHANGE_MODE will be:
5.EFFDT_DELETE_ZAP_MODE: When an effective dated row is deleted in "zap" mode, all the effective dated rows with the same key values are deleted.
For example, let us assume that we have the following 4 date effective rows for the job with JobId 100000020529001
And, if we want to delete all date-effective records of this job, we need to use EFFDT_DELETE_ZAP_MODE. Effective Date won't make any difference in this mode as it'll delete all existing date-effective records.
After deleting the rows in Zap mode, all the date-effective rows got deleted:
Here is the method that I wrote to accomplish all of these DE delete operations with different DE delete modes (download the sample application for to find the method references used in the below code).
In the above method, we're actually getting the Job row effective as of the passed effective date(this will make that effective-dated row as current row) and then performing date-effective delete operations basing on that row.
Instructions to run the sample application:
1. Create the required tables for illustrating date-effective operations executing the sql script downloading from here.
Enjoy!!!
All the date-effective delete modes are defined as constants in oracle.job.Row class as any kind of effective dated operation is performed on a row itself. Before going into details, let us take an example to explain the concepts. For example, we'll take the same example of 'Job' date-effective object and explain different date-effective delete modes available. Sample application having the required code to perform the DE delete operations can be downloaded from here.
The following DE delete modes available in Jdeveloper 11g:
1.EFFDT_DELETE_NEXT_CHANGE_MODE: When an effective dated row is deleted in "delete next change" mode, the end date of the row is set to the end date of adjoining row and the adjoining row is deleted.
For example, if the Job with JobId 100000020529001 has the following date-effective rows,
And, if the current row is [100000020529001,01-Jan-2011,31-Dec-2012] (or if the current effective date falls in the range of 01-Jan-1900 and 31-Dec-2012) and if we want to delete the next date-effective row i.e., [100000020529001,01-Jan-2013,31-Dec-4712], we'll use EFFDT_DELETE_NEXT_CHANGE_MODE.
After deleting the row in EFFDT_DELETE_NEXT_CHANGE_MODE, the resultant rows will be:
2. EFFDT_DELETE_THIS_CHANGE_MODE: When an effective dated row is deleted in "delete this change" mode, the current row is removed.
For example, let us continue with the same above 3 rows and if we want to delete the Job Row [100000020529001,01-Jan-1950,31-Dec-2010], we need to make this row as current row (i.e., the effective date will be between 1-Jan-1950 and 31-Dec-2010) and delete the row in EFFDT_DELETE_THIS_CHANGE_MODE.
After deleting the current row in EFFDT_DELETE_THIS_CHANGE_MODE, the resultant rows will be:
3.EFFDT_DELETE_MODE: When an effective dated row is deleted in "delete" mode, the end date of the row is set to the row's effective date and all the future rows for the same key values are deleted.
For example, let us assume that we have the following 4 date effective rows for the job with JobId 100000020529001
And, if we want to end date the 2nd row i.e., [100000020529001,01-Jan-1950,31-Dec-1974] at 01-Jan-1960 and want to delete all the future rows, we'll pass the effective date 01-Jan-1960 and use the mode EFFDT_DELETE_MODE.
After deleting the rows in EFFDT_DELETE_MODE mode, the resultant rows will be:
4.EFFDT_DELETE_FUTURE_CHANGE_MODE: When an effective dated row is deleted in "delete future change" mode, the end date of the row is set to the end of time and all the future rows for the same key values are deleted.
For example, let us assume that we have the following 4 date effective rows for the job with JobId 100000020529001
And, if we want to delete all future date-effective rows starting from 01-Jan-1975, then, we need to make the row [100000020529001,01-Jan-1950,31-Dec-1974] as current row (or make effective date between 01-Jan-1950 and 31-Dec-1974) and delete the rows in EFFDT_DELETE_FUTURE_CHANGE_MODE. This will delete all remaining future rows and end date the current row i.e., [100000020529001,01-Jan-1950,31-Dec-1974] till EOT(31-12-4712).
The resultant rows after deleting the rows in EFFDT_DELETE_FUTURE_CHANGE_MODE will be:
5.EFFDT_DELETE_ZAP_MODE: When an effective dated row is deleted in "zap" mode, all the effective dated rows with the same key values are deleted.
For example, let us assume that we have the following 4 date effective rows for the job with JobId 100000020529001
And, if we want to delete all date-effective records of this job, we need to use EFFDT_DELETE_ZAP_MODE. Effective Date won't make any difference in this mode as it'll delete all existing date-effective records.
After deleting the rows in Zap mode, all the date-effective rows got deleted:
Here is the method that I wrote to accomplish all of these DE delete operations with different DE delete modes (download the sample application for to find the method references used in the below code).
public void deleteJobRow(Long jobId, Date effectiveDate) { if (effectiveDate == null) { throw new JboException("Effective Date cannot be null"); } if (effectiveDate.compareTo(DateUtils.convertTosqlDate(MIN_START_DATE)) <= 0 || effectiveDate.compareTo(DateUtils.convertTosqlDate(MAX_END_DATE)) >= 0) { throw new JboException("EffectiveDate cannot be before SOT and cannot be later than EOT"); } //getting the Job row effective as of the given effectiveDate Row jobRow = getRowAsOfDate(jobId, effectiveDate); if (jobRow != null) { try { //Set the required date-effective delete mode. Here I'm setting it to EFFDT_DELETE_THIS_CHANGE_MODE jobRow.setEffectiveDateMode(Row.EFFDT_DELETE_THIS_CHANGE_MODE ); jobRow.remove(); } catch (Exception e) { e.printStackTrace(); } this.getDBTransaction().commit(); } }
In the above method, we're actually getting the Job row effective as of the passed effective date(this will make that effective-dated row as current row) and then performing date-effective delete operations basing on that row.
Instructions to run the sample application:
1. Create the required tables for illustrating date-effective operations executing the sql script downloading from here.
2. Unzip the sample application and, run the DemoAM. Input JobId, effective date and click 'Execute'.
3. Change the date-effective delete mode in method 'deleteJobRow' each time you want to change the delete mode(right now it's hard coded to EFFDT_DELETE_THIS_CHANGE_MODE), rebuild and continue. You can find the screen shots above how to provide input in AM Tester.
4. Query the DB to find the resultant rows after the delete operation.
SELECT Job_ID, TO_CHAR(effective_start_date,'dd-Mon-yyyy') AS ESD, TO_CHAR(effective_end_date,'dd-Mon-yyyy') AS EED, JOB_NAME, MIN_SAL, MAX_SAL, STATUS, JOB_LEVEL, MED_CHECK_REQ AS MED_CHECK FROM de_jobs WHERE job_id=100000020529001 ORDER BY effective_start_date;
Enjoy!!!
This comment has been removed by a blog administrator.
ReplyDeleteImpressive post with the details of the date effective delete modes and behavior forms with the example codes. Thanks for the sharing.
ReplyDeleteAdvanced app development in coimbatore | Alternate mobile apps solutions
Great Article. Thank you for sharing! Really an awesome post for every one.
DeleteAn Efficient Method for DPM Code LocalizationBased on Depthwise Separable Convolution Project For CSE
An Automated Diagnostic System for HeartDisease Prediction Based on χ2StatisticalModel and Optimally ConfiguredDeep Neural Network Project For CSE
A novel hybrid clustering algorithmbased on Minimum Spanning Tree ofNatural Core Points Project For CSE
A Novel Weight Bearing Lower Limb ExoskeletonBased on Motion Intention Prediction andLocomotion State Identification Project For CSE
Assessment of Code Smell for Predicting ClassChange Proneness using Machine Learning Project For CSE
Automatic Voice Pathology Monitoring Using Parallel Deep Modelsfor Smart Healthcare Project For CSE
Building Recognition Base on SparseRepresentation of Spatial Texture andColor Features Project For CSE
Class Incremental Learning Based on FeatureExtraction of CNN with Optimized Softmax andOne Class Classifiers Project For CSE
20170303shizhong
ReplyDeletemichael kors outlet
jordan pas cher
ghd straighteners
jimmy choo
oakley sunglasses
nike air max outlet
coach outlet
michael kors handbags
kd 9 shoes
polo ralph lauren
very nice posts. really to be appreciated awsome and a great stuff keep posting like this.having a great smile here .too good
ReplyDeleteMenmyshop
Touch Hypersonic Double Din Player Mirror
J3L Touch Double Din Player
Hypersonic Double Din Player Mirror
J3L Double Din Player Mirror
Hyundai Xcent OEM Double Din Player
banzara
O
This blog is unique from all others. Thanks for sharing this content in an excellent way. Waiting for more updates.
ReplyDeleteSpoken English Class in Anna Nagar
Spoken English Classes in Chennai Anna Nagar
Spoken English Classes in Anna Nagar West
Spoken English Classes in Chennai
Best Spoken English Classes in Chennai
Spoken English Class in Chennai
Spoken English in Chennai
English Classes in Chennai
Nice blog was really feeling good to read it. Thanks for this information.
ReplyDeleteSpoken English Classes in Chennai
Best Spoken English Class in Chennai
German Classes in Chennai
pearson vue exam centers in chennai
Informatica MDM Training in Chennai
spoken english coaching centre in chennai
top 10 ielts coaching in chennai
Hadoop Admin Training in Chennai
spanish language classes in chennai
content writing training in chennai
Spoken English Classes in Tnagar
Spoken English Classes in OMR
This was an excellent post and very good information provided, Thanks for sharing.
ReplyDeletegoogle cloud training in chennai
gcp training in Chennai
google cloud certification in chennai
google cloud platform training in chennai
google cloud certification training in chennai
mysql training in Chennai
Leadership Training in chennai
matlab Training in Chennai
Male fertility doctor in chennai
ReplyDeleteStd clinic in chennai
Erectile dysfunction treatment in chennai
Premature ejaculation treatment in chennai
Below is the high DA Free Free PPT submission sites list in India. PPT entry is the way of sending your internet site web link in PPT kind including your key phrase.
ReplyDeleteThanks for the examples.
ReplyDeleteInfycle Technology is one of the top Software Training Institute in Chennai Providing technical courses like Oracle, Java, Data Science, Big data, AWS, Python, etc., with the excellence of training and friendly trainers for freshers, experience, and Tech professionals of any field. Best place to do AWS. After completion of the course, students will be guided to crack their interview in top MNC’s. for further enquiry and free demo, of course, dial 7504633633.
ReplyDeleteCreative Marketers BD is a team of skilled digital marketers for offering quality SEO, Content Writing and Graphics Design, and Web Development works. We are providing Digital Marketing Services both for companies and individuals.
ReplyDeleteAre you Looking for cost effective Logo design in bangladesh? So you are the right place to start! With Creative Marketers BD, get the best responsive website design for your online business. We are here to help your business to be a success! We can expand your business through reaching to the right audience.
Japonya yurtdışı kargo
ReplyDeleteJamaika yurtdışı kargo
İzlanda yurtdışı kargo
İsveç yurtdışı kargo
İsrail yurtdışı kargo
LCA2OQ
This was an excellent post
ReplyDelete