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
11 replies
Subscribers
11 subscribers
Views
3798 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
Data and Records
I have changed the @Id of a view from integer to varchar2(200). The CDT XSD had
mohamedb
over 8 years ago
I have changed the @Id of a view from integer to varchar2(200). The CDT XSD had no errors and the DataStore Entity Synchronized fine with DB.
Now, I am getting a new error as shown, when I try to access the record view:
Error Evaluating UI Expression:
Expression evaluation error in rule 'wmg_gbl_generatecustomertablegrid' (called by rule 'wmg_gbl_generateaccountrecordview') at function a!queryEntity [line 11]: An error occurred while retrieving the data. (APNX-1-4198-000)
I am also attaching the record view for your reference.
application-server.log
OriginalPostID-219069
OriginalPostID-219069
Discussion posts and replies are publicly visible
0
sanjays0006
over 8 years ago
From the Query Rule/Entity, are you able to retrieve data from the modified view?
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
dominics
over 8 years ago
You may have duplicate values for the id field. If the id field is not unique it will throw errors
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
ankushj
over 8 years ago
Duplicate column gets created like A_id. Try deleting and recreating the view
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Karthik
over 8 years ago
The view's column which is mapped to the key/ID field should be distinct. Check its uniqueness.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
sparshs
over 8 years ago
try fetching data from query entity separately and if you are not able to do so. Please recreate your view and then try again. Please let us know if you face any further issues.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
mohamedb
over 8 years ago
I have checked the View. There are no duplicate rows. We use the function sys_guid() to generate unique primary keys for different rows.
Testing with a Query Rule to fetch the data from DB, it fails.
The DataStore entity synchronized successfuly with the DB.
There error I am getting on the query rule is:
Expression evaluation error in rule 'test_accountcustomerview' at function 'queryruleexec': Error evaluating function 'queryruleexec' : Unexpected error executing query (type: [WMGGBLAccountCustomerViewDT56835], query: [test_AccountCustomerView], order by: [[]], filters:[null])
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
mohamedb
over 8 years ago
This is how I create it:
CREATE OR REPLACE FORCE VIEW "APPIAN_WMG_BD"."WMG_GBL_ACNT_CSTMR_VIEW"
SELECT
RAWTOHEX(sys_guid()) AS WMG_VIEW_ID,
.
.
.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
sanjays0006
over 8 years ago
Mohamedb,
If the only purpose of WMG_VIEW_ID is to have a primary key, just use ROW_ID.
I used the same thing and it worked. I am not sure of the data type you have mentioned in the CDT for this VIew ID.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
mohamedb
over 8 years ago
@sanjays: That's what I was using in the begining, but the interface was very slow; so, we thought of trying with a different function sys_guid().
Concatenating data from different columns in a string can be an option, but again this approach is data dependent.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
mohamedb
over 8 years ago
OK, there was a datatype mismatch between the XSD and the table.
When using the above mentioned SQL statement to generate a primary key on a DB View the following XSD representation for promary key works:
<xsd:element name="id" nillable="true" type="xsd:string">
<xsd:annotation>
<xsd:appinfo source="appian.jpa">@Id @GeneratedValue @Column(name="WMG_VIEW_ID", nullable=false, columnDefinition="VARCHAR2(200)")</xsd:appinfo>
</xsd:annotation>
</xsd:element>
Also, after updating the XSD, make sure to delete the entity from the datastore; and then re-map it again; then verify the DataStore mapping is worrking - so as to ensure that the DS has picked the latest XSD version.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
>