ORA-06503: PL/SQL: function returned no value ORA-06512:

Hi all

SQL > set serveroutput on

SQL > CREATE OR replace FUNCTION qty_value (p_item_id number)

2 RETURN NUMBER

3 EAST

4 v_qty_arrival NUMBER;

5 BEGIN

6. SELECT THE CASE SENSITIVE OPTION

7. WHAT (SUM (b.quantity) - SUM (b.quantity_received)) < = 0 THEN 0

8 ELSE (SUM (b.quantity) - SUM (b.quantity_received))

9 END Qty_Arrival

10 INTO v_qty_arrival

Po_lines_all 11 a,

po_line_locations_all 12 b

13 WHERE a.po_line_id = b.po_line_id

14 AND a.item_id = p_item_id;

15 EXCEPTION

16 THEN THAN OTHERS THEN

17 v_qty_arrival: = NULL;

18 RETURN v_qty_arrival;

19 END qty_value;

20.

The function is created.

SQL >

SQL > select xxc_qty_arrivale (214960) double

2.

Select xxc_qty_arrivale (214960) double

*

ERROR on line 1:

ORA-06503: PL/SQL: function returned no value

ORA-06512: at the 'APPS '. XXC_QTY_ARRIVALE', line 19

Back AFTER using the exception block is fine as long as your code actually REACHED the exception block.

When there are no errors, then your code will not enter the exception block, but you still NEED to return a value, since it is what functions a function wants to return a value, that's what the functions are made for.

Spot the differences between the following 3 functions. Understand how they work.

The first function has only a return in the exception block but runs correctly. Result: error, because the back is missing in the code block.

The second function has a return in the exception block and one in the block of code and runs correctly. Result: no error, because the return is not missing in the code block.

The third function has a return in the exception block and one in the block of code and is forced into an error. Result: no error, because the return of the exception handler is used (instead of retriggering of the error, which you would normally do).

SQL > create or replace function myfunc

2 return number

3 as

4 start

5 dbms_output.put_line ('in the section of code');

6 null;

7 exception

8 then than others

9. can

10 dbms_output.put_line (' in the exception handler ' |) SQLERRM);

11      --

12 return 0;

13      --

14 end;

15.

The function is created.

SQL > select double myfunc;

Select double myfunc

*

ERROR on line 1:

ORA-06503: PL/SQL: function returned no value

ORA-06512: at "GHPLUS. MYFUNC", line 14

In the section of code

SQL > create or replace function myfunc

2 return number

3 as

4 start

5 dbms_output.put_line ('in the section of code');

6 null;

7    --

8 return 1;

9    --

10 exceptional

11 so that others

12. can

13 dbms_output.put_line (' in the exception handler ' |) SQLERRM);

14      --

15 return 0;

16      --

end 17;

18.

The function is created.

SQL > select double myfunc;

MYFUNC

----------

1

1 selected line.

In the section of code

SQL > create or replace function myfunc

2 return number

3 as

n number 4;

5. start

6 dbms_output.put_line ('in the section of code');

7 n: = 1/0; -force an error (zero divisor) to join the exception handler

8    --

9 return 1;

10-

exception 11

12 so that others

13. can

14 dbms_output.put_line (' in the exception handler ' |) SQLERRM);

15      --

16 return 0;

17      --

18 end;

19.

The function is created.

SQL > select double myfunc;

MYFUNC

----------

0

1 selected line.

In the section of code

In the handler for exception ORA-01476: divisor is equal to zero

SQL >

Tags: Database

Similar Questions

  • ORA-06503: PL/SQL: function returned no value

    Hi guys,.
    I wrote a function that returns the number of quarter for a given date.
    Here's the function

    FUNCTION to CREATE or REPLACE fn_get_quarter
    (p_date DATE)
    RETURN NUMBER
    AS
    v_qtr NUMBER;
    BEGIN
    Select TO_CHAR (p_date, 'Q')
    IN v_qtr
    DOUBLE;
    dbms_output.put_line (' it's quarter ' | v_qtr);
    END;

    It compiled without error.

    Here is the test case that I wrote

    DECLARE
    p_date DATE: = TO_DATE('12/22/2009','MM/DD/YYYY');
    v_qtr NUMBER;
    BEGIN
    v_qtr: = fn_get_quarter (p_date);
    END;

    When I run the present, I get the following error.

    ORA-06503: PL/SQL: function returned no value
    ORA-06512: at "GPS_FVO. FN_GET_QUARTER', line 13
    ORA-06512: at line 7

    But surprisingly, I get the result.

    Please suggest and let me know how to get rid of this error and why I get this error.

    Thanks in advance.
    Sam

    RETURN v_qtr;
    should be added after DBMS_OUTPUT

  • Function return undefined values

    My function returns undefined values. It seems that the return of the function statement is executed before the database is queried and values are assigned to variables. If I do an alert within the loop for () I get the correct values from the database, but these values are not affected before excecuting the return statement function. How can I do this differently?

    function getColumnNames(table){
        var rs1, rs2, rs3, rs4, rs5;
        db.transaction(function (tx) {
            tx.executeSql("SELECT * FROM schema WHERE table_name=?",[table], function(ax, results){
                var size = results.rows.length, i;
                var item;
                for (i = 0; i < size; i++){
                    item = results.rows.item(i);
                    rs1 = item.col1;
                    rs2 = item.col2;
                    rs3 = item.col3;
                    rs4 = item.col4;
                    rs5 = item.col5;
                                    alert(rs1); //correct value is returned here
                }
            });
        });
        return [rs1, rs2, rs3, rs4, rs5];
    }
    

    Hey Fabian,.

    You are quite correct that the return statement is executed before the database returns the results. There are ongoing asynchronous calls. You can set breakpoints in JavaScript code to see what is happening. You can correct the problem by using function callbacks. I edited your code below to use the callback functions - there might be a few typos, but the general approach should be wooded.

    function getColumnNames(table, callback){
        var rs1, rs2, rs3, rs4, rs5;
        db.transaction(function (tx) {
            tx.executeSql("SELECT * FROM schema WHERE table_name=?",[table], function(ax, results){
                var size = results.rows.length, i;
                var item;
                for (i = 0; i < size; i++){
                    item = results.rows.item(i);
                    rs1 = item.col1;
                    rs2 = item.col2;
                    rs3 = item.col3;
                    rs4 = item.col4;
                    rs5 = item.col5;
                        alert(rs5); //correct values are being returned
                    callback([rs1, rs2, rs3, rs4, rs5]);
                }
            });
        });
    }
    
    // example of how to call getColumnNames with callback
    getColumnNames('importantTable', function (result)
    {
        console.log(result);
    });
    
    // alternative version
    function onCallback(result)
    {
        console.log(result);
    }
    
    getColumnNames('importantTable', onCallback);
    

    I hope this helps.

    See you soon,.

    James

  • Do stuff to PL/SQl that returns the value and redirect to modal page by setting this value

    Hello

    a button click Page1 I would perform a PL/SQL procedure that returns a value in P1_ITEMVAL and then redirect to a page 2 (modal page) and the value of an item on this page with the value previously returned. To do the same thing with a normal page is quite easy:

    Button action is present, then process of PL/SQL that returns the value in the P1_ITEMVAL element and, finally, a branch at page 2 that sets P2_ITEMVAL with P1_ITEMVAL. I really have no idea how to do the same thing when the target is a modal page.

    I created a unit test on https://apex.oracle.com/pls/apex (application 1554 - redir_to_modal)

    Workspace: tests

    USER: supporter

    PWD: supporter1234

    Any help would be much appreciated.

    Kind regards

    Pavel

    Pavel

    If you prepare a URL using the value calculated in the PLSQL of DA part you can then use a subsequent stage of javascript to set the location of the window.

    This will jump to the top of the page of the modal dialog box

    : P1_URL: = apex_util.prepare_url)

    ' f ? p ='|| : APP_ID - Application id

    |': 2' - Page id

    ||': ' || : APP_SESSION - Session id

    ||':'                      -- Request

    ||':NO'                    -- Debug

    : ': ' - Clear Cache

    : ': ' - Settings

    ||' P2_ITEMVAL'

    : ': ' - Parameter values

    || (: P1_ITEMVAL);

    then in the action of javascript

    Window.Location.Replace ($v ('P1_URL'));

    Hope this is of some use

    Concerning

    Kelvin

  • reload the page when SQL query returns a value

    Hello world

    the title of this discussion may seem strange, but I'll try to explain why I need this:

    A user has the ability to connect on my APEX application. There are several tabs in my application that are visible only if a certain SQL statement returns a value which is not the case by default. The user has also the ability to download a file that is transferred to an external system that analyzes the file and writes the data in the database. During this writing process - which may take several minutes - conditions for some of the tabs to show the will becomes real (-> the query will return a value). When the user refreshes the page manually, the tabs will be displayed. However, I want the tabs will appear automatically when the condition is met.

    Is it possible to refresh the page as soon as the query returns a value? It is perhaps possible to check it on the client side and trigger a refresh of the page when the condition is met. It would be even better if only the tabset has been updated, but refreshing the full page is fine as well.

    Thank you!

    Here is an overview of how it can be done

    This is possible thanks to a dynamic action being performed on a timer.

    View default tabs and dynamic action hide them on loading the page if they are not to be considered

    Create a dynamic action that will execute your query every 5 seconds or more

    If the query returns data, you can use the dynamic action to show your tabs using javascript

  • Analyze: Body of PL/SQL function returning a SQL query

    I need to get the final SQL returned by the PL/SQL function.
    I'll use this final SQL in a procedure.
    Please provide only a few tips on how to get the SQL code. I already looked in the DBMS_SQL package, but I don't know if this is the right place to look.


    Kind regards
    Sumit
    declare 
    
      l2 varchar2(2000);
    
    begin
    
      l2:= 'Select NAME,ORIGINATED,OWNER,ORIGINATOR,';
      l2:= l2 || 'DESIGNATED_UNIT,SOURCE,';
      l2:= l2 || 'REFERENCE';
      l2:= l2 || ' from MV_DETAILED_DATA';
    
      /*
        Copy dynamic query SQL to application item for later use.
      */
      :app_item := l2;
    
      wwv_flow.debug('l2: ' || l2);
    
      return l2;
    
    end;
    

    I always use a call of debugging in the region of body of the PL/SQL function returning a SQL query sources so the real generated SQL can be quickly entered via the debug mode.

  • Function - return multiple values in a concatenated string

    Hello

    Is it possible for a function return a concatenated string (combining more than one number). I'm trying to return the purchase by the introduction and invoice_id number and code order number, but an invoice_id can have several PO with the same code number. I want to concatenate the PO numbers with commas, for example

    10124, 10090, 10987

    At the present time, the function returns NULL for those cases that have more than one purchase order number.

    Thank you
    func_get_po(i.invoice_id, cc.code_combination_id) "PO No",
    func_get_po_requester(i.invoice_id, cc.code_combination_id, func_get_po(i.invoice_id, cc.code_combination_id)) "PO Requester",
    

    Of course, this can be done without any problem.
    If it returns NULL, then you must debug function and check the operating logic. I know that it will take a little of your time, but not problems with the logic of syntax and concatenation.

  • Function returned no value error

    create or replace function dssppv.hra_find_short_path (
       p_new_rgmn_grp_gid    in   number
      ,p_tail_rgmn_grp_gid   in   number
      ,p_mkt_cnfgr_gid       in   number
    )
       return string
    
    is
       v_rgmn_grp_path varchar2 ( 2000 );
       check_step varchar2 ( 2000 );
    begin
       dbms_output.put_line
          ( 'Begin of function  hra_find_short_path to Check Circular Loop : '
            || to_char ( sysdate, 'YYYY-MM-DD HH24:MI:SS' )
          );
       check_step                 := ' Step 1 - Circular loop Check up.';
    
       --Checking for the circular loop
       select rgmn_path || '/' || gt.rgmn_grp_nam
       into   v_rgmn_grp_path
       from   ( select  min_rgmn_node
                       ,rgmn_path
                       ,rgmn_grp_gid
               from     ( select    level as min_rgmn_node
                                   ,dt.rgmn_grp_gid
                                   ,dt.tail_rgmn_grp_gid
                                   ,gp.rgmn_grp_nam
                                   ,rtrim
                                       ( reverse
                                            ( sys_connect_by_path
                                                      ( reverse ( gp.rgmn_grp_nam )
                                                       ,'/ '
                                                      )
                                            )
                                        ,'/ '
                                       ) as rgmn_path
                         from       dssppv.t_market_cnfgr_rgmn_grp_dtl dt join dssppv.t_market_cnfgr_rgmn_grp gp
                                    on (     dt.rgmn_grp_gid = gp.rgmn_grp_gid
                                         and gp.mkt_cnfgr_gid = p_mkt_cnfgr_gid
                                       )
                         start with dt.tail_rgmn_grp_gid = p_new_rgmn_grp_gid
                         connect by nocycle prior dt.rgmn_grp_gid =
                                                              dt.tail_rgmn_grp_gid )
               where    rgmn_grp_gid = p_tail_rgmn_grp_gid
               order by min_rgmn_node )
             ,dssppv.t_market_cnfgr_rgmn_grp gt
       where  gt.rgmn_grp_gid = p_new_rgmn_grp_gid and rownum = 1;
    
       dbms_output.put_line ( ' Circular Loop is formed as shown :'
                              || v_rgmn_grp_path
                            );
    
       if ( v_rgmn_grp_path is not null )
       then
          dbms_output.put_line ( ' Circular Loop is formed as shown :'
                                 || v_rgmn_grp_path
                               );
       else
          dbms_output.put_line ( ' No Loop is formed.' );
       end if;
    
       dbms_output.put_line
             ( 'End of function  hra_find_short_path to Check Circular Loop : '
               || to_char ( sysdate, 'YYYY-MM-DD HH24:MI:SS' )
             );
       return v_rgmn_grp_path;
    exception
     --  when no_data_found
      -- then
       --   dbms_output.put_line
        --     ( 'End  of function  hra_find_short_path to Check Circular Loop : '
         --      || to_char ( sysdate, 'YYYY-MM-DD HH24:MI:SS' )
          --   );
          --return null;
       when others
       then
          dbms_output.put_line
                         ( 'Error in function DSSPPV.hra_find_short_path at: '
                           || check_step
                         );
          dbms_output.put_line ( sqlerrm );
          dbms_output.put_line
             ( 'End of function  hra_find_rgmn_grp_loops to Check Circular Loop : '
               || to_char ( sysdate, 'YYYY-MM-DD HH24:MI:SS' )
             );
    end hra_find_short_path;
    /
    I have fully commented goal no. Data Exception not found top check if she is to return null when no record is found.

    But he was wrong in not found exception when there is no data record.

    But when run sql separately he showed zero records without don't raise the no found error of data.

    He would not even through the loop fi... Please correct me if I did something wrong
     if ( v_rgmn_grp_path is not null )
       then
          dbms_output.put_line ( ' Circular Loop is formed as shown :'
                                 || v_rgmn_grp_path
                               );
       else
          dbms_output.put_line ( ' No Loop is formed.' );
       end if;

    You may not assume that v_rgmn_grp_path will retain the NULL value if the query returns no rows. In this case AS the value of the variable is not defined. I suggest yo change:

    Select rgmn_path. '/' || gt.rgmn_grp_nam

    TO

    Select count (*) case when 1 then max(rgmn_path ||) '/' || end of gt.rgmn_grp_nam)

    This way NO_DATA_FOUND will not be raised and the v_rgmn_grp_path will be NULL if there is no corresponding line.

    SY.

  • conditional view using body of the Pl/SQL function returning a Boolean

    I have problems with the conditional display of a report.

    I have to select list: p50_facility and p50_supervisor.

    I entered the Sub function body of pl/sql returning a Boolean

    Begin
    If (: p50_facility is null or)
    (: p50_supervisor is null) THEN
    Return False;
    On the other
    Return True;
    End if;
    End;

    No matter what values are my articles on (null, not null), the report shows.

    What I am doing wrong?

    Hello

    The list values will be null only until the first time that the page is sent. Subsequently, the value is likely to be "null %."

    You should do something like:

    BEGIN
     IF (:P50_FACILITY IS NULL OR :P50_FACILITY = '%' || 'null%' OR :P50_SUPERVISOR IS NULL OR :P50_SUPERVISOR = '%' || 'null%') THEN
      RETURN FALSE;
     ELSE
      RETURN TRUE;
     END IF;
    END;
    

    Andy

  • Analytical function - return 2 values

    I don't know I need to use an analytical function to do this, I can't do things. I appreciate the help.
    Statements of table and insert:
    create table TST_CK
    (
    DOC_ID NUMBER(6)      not null,
    ROW_SEQ_NBR NUMBER(6) not null,
    IND_VALUE VARCHAR2(2) null
    )
    INSERT INTO TST_CK VALUES ('1','6',NULL);
    INSERT INTO TST_CK VALUES ('1','5',NULL);
    INSERT INTO TST_CK VALUES ('1','4','T');
    INSERT INTO TST_CK VALUES ('1','3','R');
    INSERT INTO TST_CK VALUES ('1','9',NULL);
    INSERT INTO TST_CK VALUES ('1','10',NULL);
    INSERT INTO TST_CK VALUES ('1','7','T');
    INSERT INTO TST_CK VALUES ('1','8','R');
    INSERT INTO TST_CK VALUES ('2','1',NULL);
    INSERT INTO TST_CK VALUES ('2','2',NULL);
    INSERT INTO TST_CK VALUES ('2','3','T');
    INSERT INTO TST_CK VALUES ('2','4','R');
    INSERT INTO TST_CK VALUES ('2','5',NULL);
    INSERT INTO TST_CK VALUES ('2','6',NULL);
    INSERT INTO TST_CK VALUES ('2','7','T');
    INSERT INTO TST_CK VALUES ('2','8','R');
    INSERT INTO TST_CK VALUES ('4','1',NULL);
    INSERT INTO TST_CK VALUES ('4','2',NULL);
    INSERT INTO TST_CK VALUES ('4','3','X1');
    INSERT INTO TST_CK VALUES ('4','4',NULL);
    INSERT INTO TST_CK VALUES ('4','5',NULL);
    INSERT INTO TST_CK VALUES ('4','6',NULL);
    INSERT INTO TST_CK VALUES ('4','7','T');
    INSERT INTO TST_CK VALUES ('4','8','R');
    INSERT INTO TST_CK VALUES ('4','9',NULL);
    INSERT INTO TST_CK VALUES ('4','10',NULL);
    INSERT INTO TST_CK VALUES ('4','11',NULL);
    INSERT INTO TST_CK VALUES ('4','12',NULL);
    INSERT INTO TST_CK VALUES ('4','13','T');
    INSERT INTO TST_CK VALUES ('4','14','R');
    INSERT INTO TST_CK VALUES ('4','15',NULL);
    INSERT INTO TST_CK VALUES ('4','16',NULL);
    COMMIT;
    Here is what I tried that gets me close:
    SELECT MAX (TST_CK.DOC_ID), MAX (TST_CK.ROW_SEQ_NBR), TST_CK.IND_VALUE
      FROM ASAP.TST_CK TST_CK
     WHERE (TST_CK.IND_VALUE IS NOT NULL)
    GROUP BY TST_CK.IND_VALUE
    ORDER BY 2 ASC
    Here is my desired outcome:
    CV_1      CV_2
    T           R
    Or even better result would be:
    concat(CV_1,CV_2)
    Result:
    T,R
    Thanks for looking

    G

    GMoney says:
    Basically, I just need to make sure what I captures the last T and R entered in the column

    Still not clear. You want to find the last two lines (function ROW_SEQ_NBR) where IND_VALUE is 't' & 'R', right? If so:

    with t as (
               select  doc_id,
                       row_seq_nbr,
                       ind_value,
                       row_number() over(partition by ind_value order by row_seq_nbr desc) rn
                 from  tst_ck a
                 where ind_value in ('T','R')
              )
    select  doc_id,
            row_seq_nbr,
            ind_value
      from  t
      where rn = 1
    / 
    
        DOC_ID ROW_SEQ_NBR IN
    ---------- ----------- --
             4          14 R
             4          13 T
    
    SQL> 
    

    SY.

  • APEX 4.0.1: $v () function returns multiple values for the box?

    Hello

    I have a report that uses apex_item.checkbox (...) to generate the check box. This report correctly displays a check box for each line. The source code that is generated in the html page is:
    < input type = "checkbox" name = "f01" value = "202" id = "P1_CHECKBOX" / >
    ...
    ...
    < input type = "checkbox" name = "f01" value = "220" id = "P1_CHECKBOX" / >
    ...
    ...
    < input type = "checkbox" name = "f01" value = "210" id = "P1_CHECKBOX" / >
    ...
    ...

    I want to use the javascript function $v () to get the values of the enabled check box. I thought that the return of this function all the checked values separated by ':' but I noticed that my code alert ($v ('P1_CHECKBOX')); return whenever the value of the first checkbox if it is checked.
    It returns '202' if the first box is checked, but nothing, if only the second checkbox is checked and '202' if the box of the first and the second is checked.

    Hello

    first of all, $v, $x and $s are supposed to not work for items on the page, not the columns in a table or manually generated HTML elements.

    Secondly, I think that your HTML code is not correct, because each of your boxes has the same ID. But the ID must be unique in the DOM of the browser tree. Thus the different box should actually named P1_CHECKBOX_1... P1_CHECKBOX_3. Just look at what is actually generated for a page element real checkbox. BTW, I think that you should not name the checkbox as part of page elements, because they are not actually page elements. I think that this could be confusing for other developers.

    Hope that helps
    Patrick
    -----------
    My Blog: http://www.inside-oracle-apex.com
    APEX 4.0 Plug-Ins: http://apex.oracle.com/plugins
    Twitter: http://www.twitter.com/patrickwolf

  • MONTHS_BETWEEN function returns negative values 'bad '?

    Hello

    I can't understand why these values are results.

    SQL > select months_between (to_date (February 2, 13 ',' DD-MON-RR'), to_date ('February 28, 13 ', ' DD-MON-RR')) twice;

    MONTHS_BETWEEN(TO_DATE('02-FEB-13','DD-MON-RR'),TO_DATE('28-FEB-13','DD-MON-RR')

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

    -.83870968

    SQL > select months_between (to_date (February 2, 13 ',' DD-MON-RR'), to_date ('April 1, 13 ', ' DD-MON-RR')) twice;

    MONTHS_BETWEEN(TO_DATE('02-FEB-13','DD-MON-RR'),TO_DATE('01-APR-13','DD-MON-RR')

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

    -1.9677419

    SQL > select months_between (to_date (February 2, 13 ',' DD-MON-RR'), to_date ('April 2, 13 ', ' DD-MON-RR')) twice;

    MONTHS_BETWEEN(TO_DATE('02-FEB-13','DD-MON-RR'),TO_DATE('02-APR-13','DD-MON-RR')

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

    -2

    user13393428 wrote:

    But,

    Select months_between (to_date (February 2, 13 ',' DD-MON-RR'), to_date ('April 2, 13 ', ' DD-MON-RR')) twice;

    How it is-2? Should not be-1?

    Do you really think there's only 1 month between February and April?  you have a very convenient calendar you can watch...

  • Calendar function returns strange values

    Can someone please help

    Calendar rightNow = Calendar.GetInstance ();
    int aa = Calendar.DATE;
    int bb = Calendar.MONTH;

    in aa value is 5, it is and in the bb, it is 2.

    I checked my date system as well as the date of Simulator. I don't know why it's happening.

    These values Calendar.DATE and Calendar.MONTH are the contacts to be used in conjueciton with the Calendar.getField () method.

    Like this:

    int = rightNow.getField (Calendar.MONTH) MB

  • Concatenation of strings - SQL Query (pl - sql function returning SQL query body

    Hi all

    I have just problem with the string concatenation. I would like to come back to something like "Lname, FNAMe" but below returns it Lnamefname

    v_sql: = ' SELECT concat(LNAME,FNAME) as an ENTREPRENEUR, '
    ' |' s.TEAM as TEAM, "he said.
    |' s.CONTRACT_NO as CONTRACT_NO'
    ||' S '

    I also tried below who gave the results as fname (seprate column as an entrepreneur) and lname received separately as lname... I wish I had it

    example of result should be something like: = Weigner, Lucy

    v_sql: = 'SELECT LNAME "| ', ' ||' FNAME ENTREPRENEUR,'
    ||' S.TEAM as TEAM "
    ||' S.CONTRACT_NO as CONTRACT_NO,'


    Thank you

    Lucy,

    Try

    v_sql := ' SELECT LNAME|| '',''|| FNAME CONTRACTOR,'
          || ' S.TEAM as TEAM,'
          || ' S.CONTRACT_NO as CONTRACT_NO,';
    

    See you soon,.
    Hari

  • ORA 28817 PLSQL function returned an error. When the apex 4 2 instance access

    Hello

    I just upgraded from apex to apex 4.2 4.1. All is well except for this error I get when I try to access the parameter Instance on the App Admin (localhost/apex/apex_admin)
    ORA-28817: PL/SQL function has returned an error
    What could be the problem? How we solve this problem...

    I'm working on the 2012 Win server machine... apex 4.2 with earphone 2 deployed on Glassfish 3.1.2 apex.

    Best regards
    Fateh

    Hello Faye,

    We are already aware of this problem, even if it is not yet present on our Web page of problems known. The reason for this error is that the new facility replaces an instance to the scale encryption key. In the preferences of the instance which have been encrypted with the old value (the SMTP password and the password for the portfolio), the values are not valid after the upgrade and decryption causes this error. As a work around, you can use the apex_instance_admin package to replace the invalid passwords.

    The following code shows how the decryption throws ORA-28817:

    SYS@a411> select apex_instance_admin.get_parameter('SMTP_PASSWORD') from dual;
    select apex_instance_admin.get_parameter('SMTP_PASSWORD') from dual
           *
    ERROR at line 1:
    ORA-28817: PL/SQL function returned an error.
    ORA-06512: at "SYS.DBMS_CRYPTO_FFI", line 67
    ORA-06512: at "SYS.DBMS_CRYPTO", line 44
    ORA-06512: at "APEX_040200.WWV_FLOW_CRYPTO", line 89
    ORA-06512: at "APEX_040200.WWV_FLOW_INSTANCE_ADMIN", line 239
    

    You can fix this by entering new password:

    SYS@a411> exec apex_instance_admin.set_parameter('SMTP_PASSWORD','my smtp password');
    PL/SQL procedure successfully completed.
    
    SYS@a411> exec apex_instance_admin.set_parameter('WALLET_PWD','my wallet password');
    PL/SQL procedure successfully completed.
    
    SYS@a411> select apex_instance_admin.get_parameter('SMTP_PASSWORD') from dual;
    APEX_INSTANCE_ADMIN.GET_PARAMETER('SMTP_PASSWORD')
    ----------------------------------------------------------------------------------------------
    my smtp password
    
    1 row selected.
    

    Kind regards
    Christian

Maybe you are looking for