Skip to Main Content

SQL & PL/SQL

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!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Why does function get compile without RETURN statement

UtsavMar 28 2016 — edited Mar 31 2016

Why Oracle let function(basic/nopipelined) without RETURN compile, and throws error in execution.

As we know pipelined function doesn't require Return, because of its working and for best programming practice we write it.

But below is not the case so why does it get compile, is there something else expected by Oracle.

Please guide/help me to dissect this behaviour.

SQL> create or replace function fn_compile

  2  return number

  3  is

  4  Begin

  5     null;  --Nothing to do

  6  Exception

  7     when others then

  8     raise_application_error(-20001,SQLERRM);

  9  End;

10  /

Function created.

SQL> -- Why does above function get sucessfully compiled. It is not pipelined though

SQL> -- Now, execution will throw error

SQL> select fn_compile from dual;

select fn_compile from dual

       *

ERROR at line 1:

ORA-06503: PL/SQL: Function returned without value

ORA-06512: at "POCUSER.FN_COMPILE", line 5

This post has been answered by Billy Verreynne on Mar 29 2016
Jump to Answer

Comments

3290630

HI Robin

          I have been following your posts and this is about your article n upgrading obiee 11.1.1.6 to 11.1.1.7 which was very nice however i encountered a problem when trying to run config.bat on windows. All other steps ran file but when i was trying to run the step for E:\OFMHomeDev\Oracle_BI1\bin\config.bat, it gave error such as "INST-0866: Weblogic cluster ‘bi_cluster’ is not present in this domain. This may be because the BI System is created through “Simple Install” Option which is not supported for scale out and update domain". I am confident that  it was install as Enterprise install so i am just wondering if you have seen such errors or any clue about this. Since I am little behind on the upgrade, its hard to find the right article and i have opened the oracle ticket and no luck so far. Sorry, posting it on wrong area but if you see this message please let me know at dpksubedi@gmail.com.

thanks again

https://www.rittmanmead.com/blog/2013/04/upgrading-obiee-to-11-1-1-7/

1 - 1
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Apr 28 2016
Added on Mar 28 2016
12 comments
5,794 views