Skip to Main Content

ORDS, SODA & JSON in the Database

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!

ORDS spits `ORA-01403: no data found` exception in every unclear situation

Denis SavenkoJun 26 2018 — edited Jul 11 2018

Why ORDS implementation is so that every time when something is wrong with ORDS metadata for the current schema, it returns `ORA-01403: no data found` exception? Why these exceptions are not wrapped with something meaningful? Like `REST access is not enabled for the schema` or `Module {module_name} does not exist`?

Examples of what happens:

Try to define a module when a developer didn't invoke `ords.enable_schema()` first (or forgot they are logged in as another schema user):

begin

  ords.define_module(

    p_module_name    => 'root',

    p_base_path      => '/',

    p_items_per_page => 0);

    commit;

end;

/

ORA-01403: no data found

ORA-06512: at "ORDS_METADATA.ORDS_INTERNAL", line 617

ORA-06512: at "ORDS_METADATA.ORDS_SECURITY", line 85

ORA-06512: at "ORDS_METADATA.ORDS", line 725

ORA-06512: at line 2

Try to define a template when ORDS is not enabled for the schema or when there's no such module (seriously, don't you think the developer should be able to know the actual reason of the issue):

begin

  ords.define_template(

   p_module_name    => 'root',

   p_pattern        => 'test/1.0/');

end;

ORA-01403: no data found

ORA-06512: at "ORDS_METADATA.ORDS_INTERNAL", line 617

ORA-06512: at "ORDS_METADATA.ORDS_SECURITY", line 85

ORA-06512: at "ORDS_METADATA.ORDS", line 799

ORA-06512: at line 2

Try to define a handler when ORDS is not enabled for the schema, or there's no such module or there's no such template (the further we go the more intransparent the exception becomes):

begin

    ords.define_handler(

    p_module_name    => 'root',

    p_pattern        => 'test/1.0/',

    p_method         => 'GET',

    p_source_type    => ords.source_type_plsql,

    p_source         =>

      'begin

        htp.p(''test'');

      end;',

    p_items_per_page => 0);

end;

ORA-01403: no data found

ORA-06512: at "ORDS_METADATA.ORDS_INTERNAL", line 617

ORA-06512: at "ORDS_METADATA.ORDS_SECURITY", line 85

ORA-06512: at "ORDS_METADATA.ORDS", line 826

ORA-06512: at line 2

And so on.

So, the question is - why weren't these exceptions made a little bit more meaningful?

I thought ORDS is one of the most hopeful Oracle products. Why then there's no care about its users?

Tested on ORDS 3.0, 17.4, 18.1

This post has been answered by Denis Savenko on Jul 11 2018
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 8 2018
Added on Jun 26 2018
3 comments
2,916 views