Informix

 View Only
  • 1.  dbschema

    IBM Champion
    Posted Fri November 12, 2021 02:06 PM
    Informix 12.10.FC14
    Solaris 10  1/13


    I have used dbschema to generate individual text files for each SPL by rippling through sysprocedures and calling dbschema for each one.

    That works fine, so long as SPLs are not overloaded.

    When encountering overloaded SPLs, dbschema concatenates all of the SPLs with the same name into a single text file.

    I don't see anything in the documentation for dbschema that indicates any way to disambiguate function/procedure names, or to force dbschema to generate a single file for each SPL.  I could be missing something because of the inconcistency (I would go so far as to use the term "error") in the documentation for dbschema.  (The text differs from the syntax diagram, and I believe this is true for both the 12.X and 14.X published documentation.  Of course, it wouldn't be the first time my [alleged] mind has gotten me on the wrong track.)

    I realize I could break the SPLs out manually-- there are only about 40 of them.  Or, I could program what I want by writing a script that also extracts the procid (to use in generating a unique name for the generated text files for each SPL) and also by using sed or awk to parse out the individual SPLs from the concatenated file, and create new ones, uniquely named, that each contained exactly one SPL.  But, it never hurts to (first) make sure there isn't "lazier" way to do this.

    Thank you for any comments.

    Regards,

    DG

    P.S.  I am truly grateful for the many previous responses in another thread.  This forum is very generous.  But I'd like to be clear that I am not trying to get my work done for free!   Just wondering if there is any way to use existing tools to extract a database's SPLs (particularly overloaded SPLs)  into individual files.

    ------------------------------
    David Grove
    ------------------------------

    #Informix


  • 2.  RE: dbschema

    IBM Champion
    Posted Fri November 12, 2021 02:56 PM
    P.S.  Consider the case of overloaded SPLs.  So far, I have observed that 'dbschema' dumps the SPLs in order of ascending procid.  But, this is just a few anecdotal observations.

    Does anyone know if it is necessarily so that 'dbschema' orders SPLs (of same name) by ascending procid?

    Thank you.

    ------------------------------
    David Grove
    ------------------------------



  • 3.  RE: dbschema

    IBM Champion
    Posted Fri November 12, 2021 04:02 PM
    Dbschema orders everything be it's object ID, yes.

    If you need different ordering, myschema offers three alternatives. By name and hierarchical parent first or children first.

    ------------------------------
    Art S. Kagel, President and Principal Consultant
    ASK Database Management Corp.
    www.askdbmgt.com
    ------------------------------



  • 4.  RE: dbschema

    IBM Champion
    Posted Mon November 15, 2021 08:53 AM

    One of my tweaks to myschema dumps every entity to a unique file.  For SPL it is a quick hack in print_procedures.ec