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!

APEX 5.1.x own Packaged App Supporting Object Error

Tim HalbachOct 10 2017 — edited Oct 12 2017

Hello, everyone,

I'm trying to create my own packaged app.

I have added my scripts in Supporting Objects.

If I compile these then I get the following error from my package body. (See picture)

APEX_erro_Supporting_Objects.jpg

I know it has something to do with the templating method. (See picture)

script.PNG

Anyone know a solution?

APEX 5.1.0.3

thank you

This post has been answered by Christian Neumueller-Oracle on Oct 11 2017
Jump to Answer

Comments

Christian Neumueller-Oracle
Answer

Hi Tim,

the parser for supporting objects which splits a clob into runnable statements is rather simplistic. A "/" on a single line ends the statement. For example, you could use the multi line code pattern of the APEX export files:

c_pkg_spec_script constant t_max_vc2 := apex_string.join(apex_t_varchar2 (

    'CREATE OR REPLACE PACKAGE #PKG_NAME#',

    'AS',

    '  #FUNC_PROC#',

    'END #PKG_NAME#;',

    '/' ));

Since this is about code generation, I sometimes also write templates like this to get consistent alignment and have the template stand out:

c_pkg_spec_script constant t_max_vc2 := regexp_replace(q'[

  % CREATE OR REPLACE PACKAGE #PKG_NAME#

  % AS

  %   #FUNC_PROC#

  % END #PKG_NAME#;

  % /

  ]',

  '^\s+% ', null, 1, 0, 'm' );

Regards,

Christian

Marked as Answer by Tim Halbach · Sep 27 2020
Tim Halbach

Hi Christian,

Thank you so much for that, that's exactly what I was looking for.

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

Post Details

Locked on Nov 9 2017
Added on Oct 10 2017
2 comments
267 views