CallableStatement interface IN and OUT Parameters Program | JDBC Tutorial Online

This JDBC Tutorial Online “Callable Statement interface IN and OUT Parameters” post is providing clearly how to retrieve information using stored procedure using CallableStatement interface functionality.


 

Create table:

SQL> create table student(num number(5) , name varchar2(20));

 

Insert Records:

SQL> insert into student values(1001 , ‘amar’);
SQL> insert into student values(1002 , ‘akbar’);
SQL> insert into student values(1003 , ‘anthony’);
SQL> commit;

 

SQL> select *from student;
NUM      NAME
———- ——————–
1001      amar
1002      akbar
1003      anthony

 

Creating stored procedure using IN and OUT parameters to retrieve the name of a particular record no:

SQL> create or replace procedure getName(no in number, nm out varchar2)
is
begin
select name into nm from student where num=no ;
end;
/
Procedure created.

 

Share this