Social Icons

Friday, 20 December 2013

IF else program in pl-sql

set serveroutput on;
DECLARE
   total_rows number(2);
BEGIN
   UPDATE e1111
   SET esalary = esalary + 500;
   IF sql%notfound THEN
      dbms_output.put_line('no customers selected');
   ELSIF sql%found THEN
      total_rows := sql%rowcount;
      dbms_output.put_line( total_rows || ' customers selected ');
   END IF;
END;

Function s in PL/SQL

set serveroutput on;
set verify off;
declare
a int;
c int;
b int;

function pied(x in  number)
return number
is
v number(2);
begin
c:=x+10;
return(c);

end pied;


begin
a:=&a;
 b:=pied(a);
dbms_output.put_line(b);
end;

Wednesday, 4 December 2013

calculator Structure in java Applet

import java.awt.*;
import java.awt.event.*;
import java.applet.*;


/*<applet code="carry" width="300" height= "300"></applet>*/

public class carry extends Applet
{
static final int n=3;
int i,j,k;
TextField x;


public void init()
{





setLayout(new BorderLayout());
add(new TextField(15),BorderLayout.NORTH);
setLayout(new FlowLayout(FlowLayout.LEFT));
setFont(new Font("SansSerif",Font.BOLD,30));

add(new Button("+"));
add(new Button("-"));
add(new Button("*"));
add(new Button("/"));


for(i=0;i<n;i++)
{
for(j=0;j<n;j++)
   {
   k=i*n+j;
   if(k>0)
  add(new Button(""+k));
    }

}


}

}

Tuesday, 3 December 2013

Function s in PL/SQL

set serveroutput on;
set verify off;
declare
a int;
c int;
b int;

function pied(x in  number)
return number
is
v number(2);
begin
c:=x+10;
return(c);

end pied;


begin
a:=&a;
 b:=pied(a);
dbms_output.put_line(b);
end;

Function s in PL/SQL

set serveroutput on;
set verify off;
declare
a int;
c int;
b int;

function pied(x in  number)
return number
is
v number(2);
begin
c:=x+10;
return(c);

end pied;


begin
a:=&a;
 b:=pied(a);
dbms_output.put_line(b);
end;

Sum of two no. using procedure in pl/sql

set serveroutput on;
declare
a int;
c int;
b int;

procedure pie(x IN number, y in number ,Z in out number)
is
begin
z:=x+y;
end;



begin
pie(5,6,a);
dbms_output.put_line('hello '||a);
end;

LOCAL PROCEDURE in PL/SQL

set serveroutput on;
declare
a int;
c int;
b int;

procedure pie(x in out number)
is
begin
x:=x+10;


end;

begin
a:=5;
pie(a);

dbms_output.put_line('hello '||a);
end;

IMPLICIT Cursor in PL/SQL

set serveroutput on;
declare
idc number(2);

begin

update e1111 set id=id+500;


if sql%notfound then
dbms_output.put_line('not found');

ELSIF sql%found THEN
      idc := sql%rowcount;
      dbms_output.put_line( idc || ' customers selected ');
   END IF;
END;

PL/SQL While Loop

set serveroutput on;
set verify off;
declare
i int:=1;
j int;
begin
WHILE i<10 loop
dbms_output.put_line(i);
i:=i+1;

end loop;

end;

output :













Printing pattern in PL/SQL

set serveroutput on;
set verify off;
declare
i int;
j int;
begin
for i in 1..5 loop
 dbms_output.put_line('');
 for j in 1..i loop
   dbms_output.put('*');
 end loop;
  dbms_output.new_line;
end loop;

end;

OUTPUT :


** 
*** 
**** 
*****

PL/SQL Simple Loop

set serveroutput on;
set verify off;
declare
b int:=1;
begin

loop
dbms_output.put_line(''||b);
b:=b+1;
exit when b>=10;
end loop;
end;

PL/SQL if-else Statements

set serveroutput on;
set verify off;
declare
a int;
begin
a:=&a;
if a>50 then
dbms_output.put_line('you are old');
elsif a>30 and a<50 then

dbms_output.put_line('you are young');

else

dbms_output.put_line('you are child');

end if;

end;

 

Sample Text

Sample text

 
Just Programming Cse DriveReputation Management