View without a primary key

Hi,

I am creating a view with union of two tables so this view doesn't have a primary key.

When i create CDT , appian creates a primary key and it says that a_id does not exist with the database . 

Do you know how to resolve this situation ?

 

These are my plan

1) Add a_id to the view . This i have to do some research. 

any ideas will help 

  Discussion posts and replies are publicly visible

Parents
  • Hi,

    When you map a New cdt to data store without having a primary key, Appian automatically creates a new column for primary key i.e. a_id. This new column is not accessible to for use. You need to recreate a cdt for view, you can also add a manual auto-increment in the database like,

    SELECT CAST(ROW_NUMBER() OVER(ORDER BY column_Name) AS INT) AS PRIMARY_KEY ,* FROM
    ( View ) A

    and map this column as primary key on CDT.

    Thanks

    Aditya

Reply
  • Hi,

    When you map a New cdt to data store without having a primary key, Appian automatically creates a new column for primary key i.e. a_id. This new column is not accessible to for use. You need to recreate a cdt for view, you can also add a manual auto-increment in the database like,

    SELECT CAST(ROW_NUMBER() OVER(ORDER BY column_Name) AS INT) AS PRIMARY_KEY ,* FROM
    ( View ) A

    and map this column as primary key on CDT.

    Thanks

    Aditya

Children
No Data