I am trying to create a Data type using the SQL view, but I am facing the following error:
I am unable to Adding the data type to data store. Any suggestion?
Discussion posts and replies are publicly visible
Can you elaborate on the warning that was presented to you while creating the CDT from the SQL View? Are you following the guidelines for creating a CDT from a view (i.e ensuring the PK exists and is being used in the CDT)
How can I define PK in a view?
Karanc,
Your database view will not have a Primary Key but it should have a unique identifier to each row that it outputs. That unique field will then be used as a PK while configuring the CDT
Please check the below link:
https://docs.appian.com/suite/help/20.3/Mapping_CDTs_to_Pre-defined_Database_Tables.html
Does your CDT have a field with the PK constraint?
If possible, please share the xsd of that cdt.
Database entity will not have a Primary Key. Please add PK or Unique key.
If you open the saved data store and attempt to Save/Publish it, you will receive a red error message that will be helpful to identify the specific issue. Within the message click "More Info", and share the details here.
The More info says "The data source schema does not match the type mappings: Wrong column type in Appian.vendors for column accountnumber. Found: int, expected: varchar(255) (APNX-2-4056-000)"
I have added the primary key in Data Store, but the SQL view does not have a PK. Will that be a issue?
This indicates your accountnumber column is an integer field in the database, but defined as text in your CDT. Assuming you are expecting integer, update your CDT field to type Number (Integer).
Karanc, you have a type mismatch for the field accountnumber between your SQL View and the CDT that you created. Once you fix that mismatch, you should be good to go