Wednesday, April 27, 2011

Diff of Unhandled and Handled exception


Step 1 : Create Table

 create table cust_table
 (
   NAME                                VARCHAR2(30),
   ORD_DT                            DATE,
   PUR_DATE                    DATE,
   QUANTITY                        NUMBER,
   ITEM_NO                         VARCHAR2(30)
  );
 
  Step 2 : Try to execute a block without exception part.
 
    begin
                                insert into cust_table(NAME,ORD_DT,PUR_DATE,QUANTITY,ITEM_NO) values('Sivakurunath',sysdate-1,sysdate,100,'ORA0001');
                               
                                insert into cust_table(NAME,ORD_DT,PUR_DATE,QUANTITY,ITEM_NO) values('Sivakumar',sysdate-1,sysdate,100,'ORA0002');
                               
                                update cust_table set NAME='eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee'
                                where ITEM_NO='ORA0002';
 end;
 /

  Step 3 : Do select ,Check how many rows inserted and updated.
 
 select * from cust_table;

 Step 4 : Try to execute same block with  exception.
 
  begin
 
 
 
                                insert into cust_table(NAME,ORD_DT,PUR_DATE,QUANTITY,ITEM_NO) values('Sivakurunath',sysdate-1,sysdate,100,'ORA0001');
                               
                                insert into cust_table(NAME,ORD_DT,PUR_DATE,QUANTITY,ITEM_NO) values('Sivakumar',sysdate-1,sysdate,100,'ORA0002');
                               
                                update cust_table set NAME='eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee'
                                where ITEM_NO='ORA0001';
                               
 exception
     when others then
        dbms_output.put_line(sqlerrm);
 end;
 /

 step 5 : Do select ,Check how many rows inserted and updated.

 select * from cust_table;


 step 6 : Find in which scenario transaction remain as a part of transaction (step 2 or step 4).

Prepared By
Sivakurunath S

Sunday, April 24, 2011

Sachin - Cricket God

1.I've seen GOD, he bats at no.4 for
indian in Tests. -Hayden.
2.Sachin is a genius, i'm a mere mortal. 
-Lara.
3.Sachin is Crickets GOD.
-Richards.
4.If Sachin plays well.. India sleeps well. -Harsha bhogle.
5.U get him out and half d battle is won.
-Ranatunga.
6.Der r 2 kind of batsmen in d world.1 Sachin Tendulkar.2 all the others. -Andy flower.
7.I never get tired during umpiring whenever sachin is on crease.
-Rudy Kortzen.
8.I'm fortunate dat i've 2 bowl at him nly in the nets.-Kumble.
9.We didn't lose 2 a team calld india.. We lost 2 a man calld Sachin. -Mark Taylor.
10.I've joked b4 dat der is a good chance dat I might retire b4 Tendulkar.
-MS Dhoni.
{Today Master blasters birthday.Proud to b an indian. Pray for him}. Sachin Rocks..

Wednesday, April 20, 2011

No Title Bar For Android Coding


    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        requestWindowFeature(Window.FEATURE_NO_TITLE);

Import
import android.view.Window;