Skip to Main Content

SQL Developer Data Modeler

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!

Why does SDDM not allow an index to have the same name as a constraint? DB allows that?

HansJKDec 11 2020

Hi
Why does SDDM not allow an index to have the same name as a constraint on the same table?
e.g. Primary key constraint = FND_ITEM_PK. Defining an index with the same name the index gets append with a v1.
When SDDM is set to auto create indexes for constraints when generating DDL it creates the index with the same name and that DDL is accepted by the DB (Oracle).
When that same table is then imported into a design or the design synchronised from the database, the index will be imported but again the "v1" appended to its name.
If the DB allows for an index to have the same name as a constraint, then why different in SDDM?
Thank you & Regards

Comments

DStrack

use the function apex_string.split to split clobs. (available since APEX 19.2)
select s.column_value from clob_tab, table(apex_string.split(clob_column,'class:abcd'||chr(10)||'}')) s;

Solomon Yakobson

Assuming you are on 12C or higher:

with sample as (
                select '{
adam smith
class:abcd
}
{
xxxyyyy
class:abcd
}
{
zzzz
class:abcd
}' data from dual
)
select  rownum,
        r
  from  sample,
        lateral(
                select  regexp_substr(data,'{[^}]*}',1,level) r
                  from  dual
                  connect by level <= regexp_count(data,'{')
               )
/

    ROWNUM R
---------- --------------------
         1 {
           adam smith
           class:abcd
           }

         2 {
           xxxyyyy
           class:abcd
           }

         3 {
           zzzz
           class:abcd
           }

SQL>

And if performance is a factor you can change REGEXP_SUBSTR with SUBSTR + INSTR and REGEXP_COUNT with LENGTH + REPLACE.
SY.

1 - 3

Post Details

Added on Dec 11 2020
1 comment
171 views