Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[plsql] Improve XML by adding information about TABLESPACES and SEGMENTS #3709

Open
hgodinez89 opened this issue Dec 29, 2021 · 0 comments
Open
Labels
an:enhancement An improvement on existing features / rules

Comments

@hgodinez89
Copy link

hgodinez89 commented Dec 29, 2021

Is your feature request related to a problem? Please describe.

It would be very useful to get information about the tablespaces and segments in table creation scripts. Currently, PMD don't parse this information as part of the XML.

Describe the solution you'd like

Parsing information about the tablespaces and segments in table creation scripts in PMD XML.

Describe alternatives you've considered

The only alternative may be to include this information in the XML generated by PMD.

Additional context

This is an example of a table creation script. It has a definition of tablespaces and segments for CLOB columns:

CREATE TABLE EXAMPLE_TABLE
(
 ID_COLUMN        NUMBER(10),
 LONG_DESCRIPTION CLOB,
 LONG_NOTES       CLOB
)
TABLESPACE EX_DATA
 PCTFREE 10
 PCTUSED 80
 INITRANS 1
 MAXTRANS 255
 STORAGE (
          INITIAL 160K
          NEXT 160K
          PCTINCREASE 0
          MINEXTENTS 1
          MAXEXTENTS UNLIMITED
          )
 LOB (LONG_DESCRIPTION)
 STORE AS SEG_EXAMPLETABLE_1 (
       TABLESPACE EX_INDEX
       CHUNK 4096
       CACHE
       STORAGE (
                INITIAL 160K
                NEXT 160K
                PCTINCREASE 0
               )
  INDEX IDX_EXAMPLETABLE_1 (
       TABLESPACE EX_INDEX
       STORAGE (
                INITIAL 160K
                NEXT 160K
                PCTINCREASE 0
               )
      )
 )
 LOB (LONG_NOTES)
 STORE AS SEG_EXAMPLETABLE_2 (
       TABLESPACE EX_INDEX
       CHUNK 4096
       CACHE
       STORAGE (
                INITIAL 160K
                NEXT 160K
                PCTINCREASE 0
               )
  INDEX IDX_EXAMPLETABLE_2 (
       TABLESPACE EX_INDEX
       STORAGE (
                INITIAL 160K
                NEXT 160K
                PCTINCREASE 0
               )
       )
  );

This is the current XML generated by PMD (It doesn't include TABLESPACE and SEGMENT information):

<?xml version='1.0' encoding='UTF-8'?>
<Table CanonicalImage='' Image=''>
    <ObjectNameDeclaration CanonicalImage='EXAMPLE_TABLE' Image='EXAMPLE_TABLE'>
        <ID CanonicalImage='EXAMPLE_TABLE' Image='EXAMPLE_TABLE' />
    </ObjectNameDeclaration>
    <TableColumn CanonicalImage='' Image=''>
        <ID CanonicalImage='ID_COLUMN' Image='ID_COLUMN' />
        <Datatype CanonicalImage='NUMBER(10)' Image='NUMBER(10)' TypeImage='NUMBER(10)'>
            <ScalarDataTypeName CanonicalImage='NUMBER(10)' Image='NUMBER(10)'>
                <NumericLiteral CanonicalImage='10' Image='10' />
            </ScalarDataTypeName>
        </Datatype>
    </TableColumn>
    <TableColumn CanonicalImage='' Image=''>
        <ID CanonicalImage='LONG_DESCRIPTION' Image='LONG_DESCRIPTION' />
        <Datatype CanonicalImage='CLOB' Image='CLOB' TypeImage='CLOB'>
            <ScalarDataTypeName CanonicalImage='CLOB' Image='CLOB' />
        </Datatype>
    </TableColumn>
    <TableColumn CanonicalImage='' Image=''>
        <ID CanonicalImage='LONG_NOTES' Image='LONG_NOTES' />
        <Datatype CanonicalImage='CLOB' Image='CLOB' TypeImage='CLOB'>
            <ScalarDataTypeName CanonicalImage='CLOB' Image='CLOB' />
        </Datatype>
    </TableColumn>
    <Skip2NextOccurrence CanonicalImage='' Image='' />
</Table>
@hgodinez89 hgodinez89 added the an:enhancement An improvement on existing features / rules label Dec 29, 2021
@hgodinez89 hgodinez89 changed the title [plsql] Improve XML by adding information from TABLESPACES and SEGMENTS [plsql] Improve XML by adding information about TABLESPACES and SEGMENTS Dec 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
an:enhancement An improvement on existing features / rules
Projects
None yet
Development

No branches or pull requests

1 participant