Automic Workload Automation

 View Only
  • 1.  Database Column Descriptions

    Posted Nov 26, 2019 06:10 PM
    Hi,
    Is the description for every column actually in the database? I think no.

    I need to programatically build a list of every column name for every table plus every column description for audit purposes. Plainly i don't want to do this manually!

    The docs do have the data, and its downloadable as html pages. It would require some clever scripting though given the format.
    https://docs.automic.com/documentation/webhelp/english/ALL/components/AE/12.2/DB%20Schema/db/_structure/HTML/index.htm

    Name Type MSSql Type Oracle Type DB2 Type Postgresql Nullable Description
    ACMT_Idnr int NUMBER(38,0) int int false Primary Key
    ACMT_AH_Idnr int NUMBER(38,0) int int false Reference to AH
    ACMT_TimeStamp datetime DATE timestamp timestamp true UTC - Time comment added

    I want this format - 

    Name Description
    ACMT_Idnr Primary Key
    ACMT_AH_Idnr Reference to AH
    ACMT_TimeStamp UTC - Time comment added

    Any clever suggestions?!

    Thanks!


  • 2.  RE: Database Column Descriptions
    Best Answer

    Posted Nov 27, 2019 04:56 AM
    Try this in bash:

    Column name:
    $ xmllint --html --xpath '/html/body/table[1]/tbody/tr[1]/td[1]/text()' ABLOB.html
    ABLOB_AH_Idnr

    Description:
    $ xmllint --html --xpath '/html/body/table[1]/tbody/tr[1]/td[7]/text()' ABLOB.html
    Reference to AH



  • 3.  RE: Database Column Descriptions

    Posted Nov 27, 2019 04:18 PM
    Hey Thanks Libor thanks useful.


  • 4.  RE: Database Column Descriptions

    Posted Nov 28, 2019 03:11 AM
    Happy to help. It needs some polishing but you probably got the idea.

    Good news is that DB Schema documentation is very simple HTML which makes this task easier.

    Have fun!