REGISTER FREE to Receive Instant Job

Thursday, 13 November 2014

Difference between PL/SQL procedures & functions

Difference between PL/SQL procedures & functions

  • PL/SQL function explicitly returns a value whereas PL/SQL procedure doesn’t.
  • PL/SQL procedure uses “OUT” type parameters for returning values.
  • In PL/SQL, parameters can be of 3 types-


Syntax of defining PL/SQL procedures:


Syntax of defining PL/SQL functions:


Callable Statement is used to invoke procedures and functions.

Invoking a procedure & function from a Java Application requires following step-1. CallableStatement object is created.

prepareCall() method of Connection interface is used to obtain a CallableStatement object.

public CallableStatement prepareCall (String CallableString) throws SQLException;

2.Value of all IN type parameters is set.

setter methods exposed by PreparedStatement interface is used for setting the value of IN
type parameters.

Type of value expected from each OUT type parameter is specified.

registerOutParameter() method of CallableStatement interface is used to specify the type of
OUT parameters.

public void registerOutParameter(int index, int type) throws IOException;

0 comments:

Post a Comment

Popular Posts

Powered by Blogger.

About Me

My photo

JobsAcid is a 'job search engine' to provide finding a job on the internet easier for the user. It has designed as huge selection of job offerings on the same search engine.