Do we need to specify columnDefinition for view CDTs?

Certified Senior Developer

Hello All,

I would like to know what is the best practice while creating view CDT's? do we need to specify column length while creating view cdt's?

Observed column length in view cdt is different from actual table column length, in this scenario view still exists upon publishing view cdt.

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer

    No. Appian would use the field definition if it would create the table for you. As you map the CDT to a view, length is not relevant.

  • 0
    Certified Senior Developer
    in reply to Stefan Helzle

    Thank you for the response.

    Curious to know how Appian DS publish will recognize the CDT as a view?

    When I download the DDL script of the view which is generated upon verify of DS, it says to create a table for view.

    Ex: below is the snippet of view DDL script and the xsd. I have not specified any column length for the varchar field in xsd and it's automatically adding as 255 chars.

    So is it advisable to create the view in DB first and later publish it via CDT? if so above DDL is not valid as DB object exists with the same name ? please help to understand how publishing works for views?

  • 0
    Certified Lead Developer
    in reply to Sneha Yada

    Appian does not know about views. When validating the data store, it tries to get the structure for an existing table OR view. If that does not match, it tries to create TABLES.

    Our approach is: Let Appian manage all the tables, then create a SQL script which adds any necessary indexes and views. That script includes a "DROP TABLE" statement for each view because Appian created that as the datastore was published.

    There are other approaches, but this works very well for us.

Reply
  • 0
    Certified Lead Developer
    in reply to Sneha Yada

    Appian does not know about views. When validating the data store, it tries to get the structure for an existing table OR view. If that does not match, it tries to create TABLES.

    Our approach is: Let Appian manage all the tables, then create a SQL script which adds any necessary indexes and views. That script includes a "DROP TABLE" statement for each view because Appian created that as the datastore was published.

    There are other approaches, but this works very well for us.

Children