Professional Documents
Culture Documents
Example 1:
create or replace procedure my_first_proc is
greetings varchar2(20);
begin
greetings := 'Hello World';
dbms_output.put_line(greetings);
end my_first_proc;
Example 3:
create or replace procedure my_third_proc (i number) is
greetings varchar2(20);
j number;
begin
greetings := 'Hello World';
dbms_output.put_line(greetings);
j := i;
dbms_output.put_line(j);
end my_third_proc;
To run my_third_proc:
1. execute my_first_proc(10);
2. begin
my_first_proc(10);
end;
Example 4:
declare
V_sname student.sname%TYPE;
V_branch student.branch%TYPE;
begin
FindStudent(1201, V_sname, V_branch);
end;
Example 5:
create or replace procedure studentInsert(
v_sno student.sno%TYPE,
v_sname student.sname%TYPE,
v_branch student.branch%TYPE,
v_age student.age%TYPE) Is
begin
insert into student(sno,sname,branch,age)values(v_sno,v_sname,v_branch,v_age);
commit;
end studentInsert;
declare
begin
studentInsert(1222,'sreenu','it',28);
end;