Retrieving Oracle Sequences

Forum
Hassan
2014-06-13
2014-08-07
  • Hassan

    Hassan - 2014-06-13

    Is there anyway to retrieve sequences in oracle? Its important because Oracle(prior to v12) does not have identity columns. The only way to work around that was to create a sequence and trigger on the table to assign the value from the sequence. But since the schemcrawler autoincrement flag will always come back false, how can that be detected?

     
  • Sualeh Fatehi

    Sualeh Fatehi - 2014-06-13

    Are you using the API, or SchemaCrawler from the command-line. If you are using the command-line, as a short term solution, you can do a custom query on ALL_SEQUENCES. I will look into putting in API support later.

     
  • Hassan

    Hassan - 2014-06-19

    Nope. using the JAVA Api

     
  • Sualeh Fatehi

    Sualeh Fatehi - 2014-06-19

    Ok. I am in the process of putting in support for database sequences. You will see that soon in the next SchemaCrawler version.

     
  • Sualeh Fatehi

    Sualeh Fatehi - 2014-06-24

    Hassan,

    I have put in support for sequences in SchemaCrawler 10.10.01. Please use this version. Thanks.

    Sualeh.

     
  • Günter Leimbeck

    Hi Sualeh,

    is there a include/exclude rule in schemacrawler.config.properties for sequences ?
    I tried following with no scuccess:

    schemacrawler.sequence.pattern.include=.*
    schemacrawler.sequence.pattern.exclude=.*.(MDRS_*|MDRT_*|MDOT_*).*
    

    Regards Günter

     
    Last edit: Sualeh Fatehi 2014-08-06
  • Sualeh Fatehi

    Sualeh Fatehi - 2014-07-05

    Günter,

    I forgot to do that. I will add it in as soon as I can.

    Sualeh.

     
  • Sualeh Fatehi

    Sualeh Fatehi - 2014-07-05

    Günter,

    Please use SchemaCrawler 10.10.03, and let me know if it works for you.

    Sualeh.

     
  • Günter Leimbeck

    Hi Sualeh,

    sorry for the delay, i downloaded 10.10.03 and tried with following commandline:
    sc -database=<db> -user=<user> -password=<pwd> -schemas=<schema> -infolevel=maximum -command=details -noinfo -portablenames -sequences=.* -outputfile=<file>

    schemacrawler.config.properties includes following lines:
    schemacrawler.sequence.pattern.include=.
    schemacrawler.sequence.pattern.exclude=.
    .(MDRS_|MDRT_|MDOT_).

    The outputfile still includes following lines:

    Sequences

    MDRS_298914$ [sequence]
    increment 1
    minimum value 1
    maximum value 9999999999999999999999999999
    cycle false

    Where is my mistake ?
    How can i exclude the "MDRS_298914$" (ORACLE spatial) sequence ?

    Regards Günter

     
  • Sualeh Fatehi

    Sualeh Fatehi - 2014-07-15

    Günter,

    1. Please do not use the -sequences=.* command-line option, since it overrides the configuration file.
    2. Please change your exclude pattern to
    .*(MDRS_.*|MDRT_.*|MDOT_.*)
    

    Let me know if this helps. If it still does not work, I will have to test against my test Oracle database. Thanks.

    Sualeh.

     
    Last edit: Sualeh Fatehi 2014-07-15
  • Günter Leimbeck

    Hi Sualeh,

    did not got it to work, since -sequences default to showing no sequences.
    What should i enter for the parameter -sequences to not override the configuration ?
    I would appreciate a -sequences=true to override the default and enable the configuration file settings.

    Regards Günter

     
  • Sualeh Fatehi

    Sualeh Fatehi - 2014-07-21

    Günter,

    One more try, please. Can you try this:

    -sequences=.*\.(?!(MDRS_|MDRT_|MDOT_)).*
    

    Sualeh.

     
  • Günter Leimbeck

    Sualeh,

    -sequences=..(?!(MDRS_)). works

    with:

    -sequences=..(?!(MDRS_|MDRT_|MDOT_)).

    I get following error:
    "Der Befehl "MDRT_" ist entweder falsch geschrieben oder konnte nicht gefunden werden."

    Günter

     
  • Sualeh Fatehi

    Sualeh Fatehi - 2014-07-30

    Günter,

    Please use SchemaCrawler 10.10.04, without the -sequences command-line option.

    Sualeh.

     
  • Sualeh Fatehi

    Sualeh Fatehi - 2014-08-06

    Günter,

    Did this work for you?

    Sualeh.

     
  • Günter Leimbeck

    Sualeh,

    i tried with SchemaCrawler 10.10.04 and 10.10.05 but in both cases i got without keywort -sequences=<expr> no sequences at all in the outputfile.

    Günter

     
  • Sualeh Fatehi

    Sualeh Fatehi - 2014-08-06

    Günter,

    What did you have in your config file? That is, what did you use for schemacrawler.sequence.pattern.include and schemacrawler.sequence.pattern.exclude?

    Sualeh.

     
  • Günter Leimbeck

    Sualeh,

    thanks for the hint, i found my mistake - wrong setting of schemacrawler.sequence.pattern.include

    schemacrawler.sequence.pattern.include=
    schemacrawler.sequence.pattern.exclude=.*(MDRS_.*|MDRT_.*|MDOT_.*)

    after setting to:

    schemacrawler.sequence.pattern.include=.*
    schemacrawler.sequence.pattern.exclude=.*(MDRS_.*|MDRT_.*|MDOT_.*)

    everything (include/exclude) is working fine, thanks Sualeh.

    Günter

     
  • Sualeh Fatehi

    Sualeh Fatehi - 2014-08-07

    Glad that it is working for you, Günter.

     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks