Don't ask for a lighter load, but pray god for a stronger back.
Thursday, September 16, 2010
Monday, September 13, 2010
Wonderful Definitions
School
Life Insurance
A place where Parents pay and children play
Life Insurance
A contract that keeps you poor all your life
so that you can die Rich.
Nurse:
Marriage
Divorce
Tears
Lecture
A person who wakes you up to give you sleeping pills.
Marriage
It's an agreement in which a man loses his bachelor degree and a woman gains her masters..
Divorce
Future tense of Marriage.
Tears
The hydraulic force by which masculine willpower is defeated by feminine waterpower.
Lecture
An art of transferring information from the notes of the Lecturer to the notes of the students without passing through "the minds of either"
Conference
The confusion of one man multiplied by the number present.
Compromise
The art of dividing a cake in such a way that everybody believes he got the biggest piece
Dictionary
A place where success comes before work
Conference Room
A place where everybody talks, nobody listens and everybody disagrees later on
Father
A banker provided by nature
Criminal
A person no different from the rest
...except that he/she got caught
Boss
Someone who is early when you are late and late when you are early
Politician
One who shakes your hand before elections and
your Confidence after
DOCTOR
A person who holds your ills by pills, and kills you by bills.
Classic
Books, which people praise, but do not read.
Smile
A curve that can set a lot of things straight.
Office
A place where you can relax after your strenuous home life.
Yawn
The only time some married men ever get to open their mouth.
Etc.
A sign to make others believe that you know more than you actually do.
Committee
Individuals who can do nothing individually and sit to decide that nothing can be done together.
Experience
The name men give to their mistakes.
Atom Bomb
An invention to end all inventions.
Philosopher
A fool who torments himself during life, to be wise
Saturday, August 28, 2010
CHECK CONSTRAINTS ON SYSDATE IN ORACLE
RESTRICTIONS ON CHECK CONSTRAINTS
I.We cannot specify a check constraint for a view. However, you can define the view using theWITH CHECK OPTION clause, which is equivalent to specifying a check constraint for the view.II.The condition of a check constraint can refer to any column in the table, but it cannot refer to columns of other tables.
III.Conditions of check constraints cannot contain the following constructs:
- Subqueries and scalar subquery expressions
- Calls to the functions that are not deterministic (
CURRENT_DATE,CURRENT_TIMESTAMP,DBTIMEZONE,LOCALTIMESTAMP,SESSIONTIMEZONE,SYSDATE,SYSTIMESTAMP,UID,USER, andUSERENV) - Calls to user-defined functions
- Dereferencing of
REFcolumns (for example, using theDEREFfunction) - Nested table columns or attributes
- The pseudocolumns
CURRVAL,NEXTVAL,LEVEL, orROWNUM Date constants that are not fully specified
So from the above detail its quite clear that we can not write any comparison with SYSDATE in check constrains..
Now imagine a situation that we are having one table and in that table we want some validation. The requirement is that we are taking Date Of Birth from the user and we want that only that user's details can reside inside our table who is older then 18 years else his insert should not take place.
So for this validation we have to write one trigger to take care of this situation.
/*This trigger will fire on every insert on table name TABLE_NAME and check that the date inserted in DOB_COLUMN_NAME column is greater than the difference of SYSDATE and inserted value by 18 and accordingly either it will allow the data to go inside the table or abort the transaction. :NEW and :OLD are co-relation identifiers used to check for the value inserted, updated or deleted. It will work only in triggers*/
CREATE OR REPLACE TRIGGER PROJECT_NAME_AGE_CHECK_TRIGGER
AFTER INSERT AFTER UPDATE ON TABLE_NAME
FOR EACH ROW
DECLARE
V_AGECHECK EXCEPTION;
BEGIN
IF MONTHS_BETWEEN(SYSDATE,:NEW.DOB_COLUMN_NAME)/12 < 18 THEN
RAISE V_AGECHECK;
END IF;
EXCEPTION
WHEN V_AGECHECK THEN
RAISE_APPLICATION_ERROR(-20001,'YOU ARE MINOR') ;
END;
A Glass Jar And Two Cups Of Tea
Glass Jar And Two Cups Of Tea
A life reforming Story
A time comes in life when we desire to do everything very fast ,to get everything as soon as possible, and then twenty-four hours a day seems less to have that, at that time we should remember this life reforming story, "A glass jar and two cups of tea".
A professor of philosophy came in the classroom and told the students that he is going to teach an important lesson of life.
He brought along a big glass jar and kept it on the table and then he began putting table tennis balls in the jar until the jar was full enough, not to take any more balls.
He asked the students, “Is the jar completely filled?”
Students shouted, “Yes.”
Then Professor started putting small stone fillings in the jar. He shook the jar and a good amount of stone filling were adjusted in the jar.
The Professor asked again, “Is the jar completely filled now?”
Students shouted once again, ”Yes.”
Then the Professor started pouring sand slowly in that jar.
Sand made its way into the jar where it was possible.
Now students laughed at their innocence.
Professor asked again “Now this jar is completely filled, isn’t it?”
Students said,” Yes, Now it is full.”
Then professor took two cup of tea and poured into the jar.The tea made its place in the jar and was soaked by the sand.
Now Professor started explaining everything in a serious voice.
Consider this glass jar as your life. The most important things are table tennis balls i.e. God, family, kids, friends, Health and hobbies.
Small stone fillings symbolises your job, car, house etc.
Sand means some more small useless things like estrangement, misunderstandings, quarrels etc.
Now if you fill the glass jar with sand first then there will be no space left for balls and stone fillings. Or if you put stone fillings first then there will be no room for table tennis ball, but still that could hold sands.
Same philosophy applies to life.
If you are going behind those little things and destroying you energy on them then you will not have much time to spend on the necessary and important things.
What is important for the happiness of soul? First decide that. Play with your children, put water in the garden, and go for morning walk with wife.Throw out all useless stuff from home; go for medical check-up regularly.Worry about table tennis balls first, that is most important. First decide what is important? Rest all is send only.
Students were listening attentively.
Suddenly a student asked, “Sir, but you have not told anything about those two cups of tea." What is that meant for?
Professor smiled and said,” I was expecting this question for a long time.”
The answer is, “no matter how busy, complete and satisfied your life seems, but there must be place for sharing two cups of tea with your special friend.
So consider this story seriously and try to implement it in your life to make your life happy and peaceful.
Subscribe to:
Posts (Atom)
























