Publishing PL/SQL Functions/Procedures

Let’s learn how to publish PL/SQL functions and procedures as Web Services using the Oracle XML DB Web Services.

Creating PL/SQl Packages and Functions

First, we create a PL/SQL package with the check_transactions() function that checks the transaction data (create_trading_pkg.sql):

CREATE OR REPLACE PACKAGE trading_pkg AS

     FUNCTION check_transactions(p_uname IN VARCHAR2,p_pwd IN VARCHAR2) RETURN XMLType;

END trading_pkg;

/

CREATE OR REPLACE PACKAGE body trading_pkg AS

     FUNCTION check_transactions(p_uname IN VARCHAR2,p_pwd IN VARCHAR2) RETURN XMLType

     AS

          v_out xmltype :=xmltype(‘<null/>’);

          v_md5key raw(16);

     BEGIN

          SELECT c.client_pwd INTO v_md5key FROM client_tbl ...

Get Oracle Database 11g Building Oracle XML DB Applications now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.