0% found this document useful (0 votes)
10 views2 pages

PL SQL Program

The document contains SQL code for creating and calling several stored procedures. These procedures include 'display' for a greeting message, 'addition11' for adding two integers, 'evenodd' for checking if a number is even or odd, and 'grade' for determining a grade based on a score. Each procedure is defined with specific input parameters and outputs a message or result based on the logic implemented.

Uploaded by

SAISH GAMING
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views2 pages

PL SQL Program

The document contains SQL code for creating and calling several stored procedures. These procedures include 'display' for a greeting message, 'addition11' for adding two integers, 'evenodd' for checking if a number is even or odd, and 'grade' for determining a grade based on a score. Each procedure is defined with specific input parameters and outputs a message or result based on the logic implemented.

Uploaded by

SAISH GAMING
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Simple program:

delimiter $$

create procedure display()

begin

select "hello Pradip " as message;

end $$

delimiter ;

call display();

delimiter $$

create procedure addition11( in a int,in b int,out c int )

begin

declare c int;

set c=a+b;

select c as result;

end $$

delimiter ;

call addition(10,20);

delimiter $$

create procedure evenodd( in a int)

begin

if a%2=0 then

select "Even" as message;

else
select "odd" as message;

end if;

end $$

delimiter ;

call evenodd(11);

delimiter $$

create procedure grade( in a int)

begin

if a>=90 then

select "Excellent" as grade;

elseif(a<90 and a>=60) then

select "Good" as grade;

else

select "fail" as grade;

end if;

end $$

delimiter ;

call grade(80);

You might also like