Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

PL/SQL Function Body Returning Error Text - Call Stored Procedure

Steve RoachJun 15 2020 — edited Jun 16 2020

Hi Guys,

Is it possible to have a validation that returns an error message from a stored procedure call.

For example:

Stored Procedure:

------------------------------------------------------------------------------------------------

create or replace PACKAGE my_pkg AS

  FUNCTION a_function

  (

    p_param_01                    VARCHAR2

   ,p_param_02                    VARCHAR2

  )

  RETURN VARCHAR2;

END my_pkg;

create or replace PACKAGE BODY my_pkg AS

  FUNCTION a_function

  (

    p_param_01                    VARCHAR2

   ,p_param_02                    VARCHAR2

  )

  RETURN VARCHAR2

  IS

    l_message VARCHAR2(200);

  BEGIN

    -- Some code that assigns either an error message or NULL to l_message

    RETURN l_message;

  END a_function;

END my_pkg;

------------------------------------------------------------------------------------------------

Apex Validation: Type: PL/SQL Function Body Returning Error Text

------------------------------------------------------------------------------------------------

RETURN my_pkg.a_function(:P1_ITEM_1, :P1_ITEM_2);

------------------------------------------------------------------------------------------------

This doesn't work but is there an approach that does?

TIA

Steve

This post has been answered by Steve Roach on Jun 16 2020
Jump to Answer
Comments
Post Details
Added on Jun 15 2020
2 comments
1,423 views