Skip to Main Content

SQL Developer

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!

[4.2EA] Syntax error message in 'Code Outline'

ApexBineSep 20 2016 — edited Sep 20 2016

The code at the bottom gives me an error in the Code Outline window.

pastedImage_3.png

The code was already shown as invalid in earlier versions, too, although it compiled and ran without error.

pastedImage_4.png

Here's the complete code:

SET SERVEROUTPUT ON

declare

function remove_duplicates(

p\_in\_string     varchar2

, p_delimiter varchar2

)

return varchar2

is

v\_result    varchar2( 32000 );

begin

select listagg(

                single\_values

              , p\_delimiter

       )

       within group (order by single\_values)

  into v\_result

  from (select distinct trim(

                              regexp\_substr(

                                             t.in\_string

                                           ,    '\[^'

                                             || p\_delimiter

                                             || '\]+'

                                           , 1

                                           , levels.column\_value

                              )

                        )

                          as single\_values

          from (select p\_in\_string in\_string

                  from dual) t

             , table(

                      cast(

                            multiset(

                                      select     level

                                            from dual

                                      connect by level \<=   length(

                                                                    regexp\_replace(

                                                                                    t.in\_string

                                                                                  ,    '\[^'

                                                                                    || p\_delimiter

                                                                                    || '\]+'

                                                                    )

                                                            )

                                                          + 1

                            ) as sys.odcinumberlist

                      )

               ) levels);

return v\_result;

end;

begin

DBMS_OUTPUT.PUT_LINE(remove_duplicates('1,2,3,2,3,4,5,3,2,2,2,4,5',','));

end;

Best regards,

Sabine

This post has been answered by thatJeffSmith-Oracle on Sep 20 2016
Jump to Answer

Comments

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

Post Details

Locked on Oct 18 2016
Added on Sep 20 2016
2 comments
212 views