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
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
Use ROWNUM and define this field as a primary key in cdt. SELECT ROWNUM as ID, <columns> FROM (select <columns> from <table1> union select <coulumns> from <table1> ); Your XSD: <xsd:element name="id_int" type="xsd:int"> <xsd:annotation> <xsd:appinfo source="appian.jpa">@Id</xsd:appinfo> </xsd:annotation> </xsd:element>