O'Reilly logo

Oracle Database 11g: Building Oracle XML DB Applications by Jinyu Wang

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required