Santosh's profileSantosh KumarPhotosBlogListsMore Tools Help

Blog


    Short Story ... Discipline gives you freedom to fly

     
    A boy was flying a kite with his father and asked him what kept the kite up. Dad replied, "The string." The boy said, "Dad, it is the string that is holding the kite down." The father asked his son to watch as he broke the string.
     
    Guess what happened to the kite? It came down. Isn't that true in life? Sometimes the very things that we think are holding us down are the things that are helping us fly. That is what discipline is all about.
     
    What we think is pulling us down is really taking us up. That is what discipline is all about.
     
    by Shiv Khera { You Can Win }
     

    Short Story ... What are we trying to prove

     
    A young executive with poor self-esteem was promoted but he couldn't reconcile himself to his new office and position. There was a knock at his door. To show how important and busy he was, he picked up the phone and then asked the visitor to come in. As the man waited for the executive, the executive kept talking on the phone, nodding and saying, "No problem, I can handle that." After a few minutes he hung up and asked the visitor what he could do for him. The man replied, "Sir, I'm here to connect your phone."
     
    Why pretend? What are we trying to prove? What do we want to accomplish? Why do we need to lie? Why look for feelings of false importance? All of this comes from insecurity and poor self-esteem.
     
    by Shiv Khera { You Can Win } 

    Oracle, Keeping last few records in a table

     
    Many times some fixed number of transaction is required to maintain for some trailing purpose but it does not require keeping history of the same. In such a situation deleting unwanted data is a good idea.
     
    Following set of statements is describing how to keep last 5 records in the table. The delete statement given below can be used to trigger at each insertion of record.
     
    SQL> SELECT RID, DETAIL, AMT, TO_CHAR(RDT,'DD/MON/YYYY HH:MI:SS') RDT
      2  FROM ANYTABLE ORDER BY RDT DESC;
     
           RID DETAIL            AMT RDT
    ---------- ---------- ---------- --------------------
          5036 FUEL              600 01/DEC/2008 04:52:49
          5035 RENT              300 01/DEC/2008 04:52:26
          5034 STATIONARY         50 01/DEC/2008 04:51:54
          5033 SALARY           5000 01/DEC/2008 04:51:36
          5032 DEBTOR            350 01/DEC/2008 04:51:13
          5031 INT               600 01/DEC/2008 04:50:03
          5030 DUE               200 01/DEC/2008 04:50:01
     
    7 rows selected.
     
    SQL> DELETE FROM ANYTABLE WHERE RID IN(
      2  SELECT RID FROM(
      3  SELECT ROWNUM SNO, RID FROM(
      4  SELECT RID FROM ANYTABLE ORDER BY RDT DESC
      5  )
      6  )
      7  WHERE SNO>5
      8  )
      9  /
     
    2 rows deleted.
     
    SQL> SELECT RID, DETAIL, AMT, TO_CHAR(RDT,'DD/MON/YYYY HH:MI:SS') RDT
      2  FROM ANYTABLE ORDER BY RDT DESC;
     
           RID DETAIL            AMT RDT
    ---------- ---------- ---------- --------------------
          5036 FUEL              600 01/DEC/2008 04:52:49
          5035 RENT              300 01/DEC/2008 04:52:26
          5034 STATIONARY         50 01/DEC/2008 04:51:54
          5033 SALARY           5000 01/DEC/2008 04:51:36
          5032 DEBTOR            350 01/DEC/2008 04:51:13
     
    SQL> 
     
    »»»»»»»   by Santosh Kumar ? Original @ http://santu4you.spaces.live.com