I have some doubts regarding the mapping among "DB-> CDT-> Query Rule

I have some doubts regarding the mapping among "DB-> CDT-> Query Rule"
1). Can we map a CDT to existing database table which does not have any primary key defined? (I cannot modify the existing tables and the tables don't have primary keys defined. I tried but it does not allow to map if the Primary Key is not there)

2). Can we map a CDT to SQL function and use it to retrieve the data from function? (I guess we cannot)...

OriginalPostID-124907

OriginalPostID-124907

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer
    1) Yes this is possible, the underlying database table does not need to have a primary key defined at the DB level however you must annotate one column using the @Id jpa annotation. I would hope that the table does have some level of unique-ness so choose the appropriate column for this. If your column does not contain unique data then you will not see the full resultset when using query rules.
    2) This may depend on your RDBMS, in Oracle for example you can define function based columns in both tables and views which can be mapped to appian datatypes
Reply
  • 0
    Certified Lead Developer
    1) Yes this is possible, the underlying database table does not need to have a primary key defined at the DB level however you must annotate one column using the @Id jpa annotation. I would hope that the table does have some level of unique-ness so choose the appropriate column for this. If your column does not contain unique data then you will not see the full resultset when using query rules.
    2) This may depend on your RDBMS, in Oracle for example you can define function based columns in both tables and views which can be mapped to appian datatypes
Children
No Data