Appian Community
Site
Search
Sign In/Register
Site
Search
User
DISCUSS
LEARN
SUCCESS
SUPPORT
Documentation
AppMarket
More
Cancel
I'm looking for ...
State
Not Answered
Replies
10 replies
Subscribers
7 subscribers
Views
2806 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
General
1- I have created an Oracle DB View using the attached DDL; it is working fine i
mohamedb
over 8 years ago
1- I have created an Oracle DB View using the attached DDL; it is working fine in the DB and it does not have a primary key.
2- I then created the corresponding CDT using the XSD attached.
3- Now, when I try to add the entity representing this view to the Data Store and click Verify I get the attached error message.
Please, advise on how to solve this problem. My end goal is to use this view to fetch data into tables used on my entity backed record that get its information from another table.
view + xsd + error.zip
OriginalPostID-211587
OriginalPostID-211587
Discussion posts and replies are publicly visible
0
ChristineH
Certified Lead Developer
over 8 years ago
I can't ope the attachment from my phone, but can you confirm in your cdt you are using the @id annotation. Appian will need you to identify a u inquest field. If you don't have one consider concatenation of the fields plus a delimiter to make a unique field.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
abhinavg712
Certified Lead Developer
over 8 years ago
Add @ID in CDT to have a primary key
forum.appian.com/.../Using_Database_Views.html
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
abhinavg712
Certified Lead Developer
over 8 years ago
You can also click on More Info -- when you are trying to verify the added CDT as it gives the detailed description in case there is a mismatch between table and CDT design
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
mohamedb
over 8 years ago
@christineh: Agree that an @id is needed by Appian.
@abhinavg712: The trick here is that this view is representing an M-to-N relationship; so it does not really have a primary key.
From a DB perspective, do you have an idea how to add an extra column while creating this view which will be auto-incremented for instance?
Then, it will be easy to add the @id notation while creating the XSD?
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
ChristineH
Certified Lead Developer
over 8 years ago
In the past, I have used a rownum, but most commonly I concate fields together with a - to make unique field.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
PhilB
Certified Lead Developer
over 8 years ago
I can't remember the Oracle equivalent, but in MySQL there's a UUID() function you can use to generate an ID column - no doubt Oracle has something similar.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
abhinavg712
Certified Lead Developer
over 8 years ago
You can make an unique key/column in view by concatenating few other key's /columns available in that table, so that you can have unique identifier and which helps in avoiding other issues which might come if you don't have a unique identifier such as grid selection
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
mohamedb
over 8 years ago
This solved the problem:
CREATE OR REPLACE VIEW WMGCDD_ACNT_CSTMR_VIEW AS
SELECT
ROWNUM AS WMGCDD_VIEW_ID,
Thank you all!
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
mohamedb
over 8 years ago
ROWNUM is a built in function that puts the column number into the additional view column; so that we can use the @id notation while defining XSD for Appian.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
nageswararaoa
over 8 years ago
Based on your view data you can make a unique column by concatnating the column values.
I am not sure what data your view returning.But try to make a unique column by concatnationg the columns which are joined in your view.
If it is not possible to make a unique column refer the below link to generate an unique id using sequence
community.oracle.com/.../2190087
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel