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
4 replies
Subscribers
7 subscribers
Views
1413 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
AI and Rules
Does the syntax changes if you are using a database "view" as apposed
robr
over 9 years ago
Does the syntax changes if you are using a database "view" as apposed to a "table" in a query rule?
I have a CDT based on a Database view. I created a data store from it. I then created a Query Rule. Everything seems to be fine so far.
I then user the Query Rule in a an express rule which looks like the following:
local!applicationRTOs: rule!getApplicationRTOs(ri!relationshipManagerIncentive_Int),
When I attempt to access via Tempo I get the following error:
Expression evaluation error in rule 'getapplicationrtos' (called by rule 'applicationrtodatafieldsui'): Error evaluating function 'queryruleexec' : Unexpected error executing query (type: [ApplicationRTOsViewDT6520], query: [getApplicationRTOs], order by: [[Sort[description asc]]], filters:[(relationshipMgrIncentive = TypedValue[it=1,v=31541])])
I have triple checked my syntax but I could still be wrong. I am using 7.4...
OriginalPostID-108776
OriginalPostID-108776
Discussion posts and replies are publicly visible
0
priyal.patel
Appian Employee
over 9 years ago
Looking at your logs might provide you a little bit more insight! Can you tell us what the logs say?
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
jesse.triplett
Appian Employee
over 9 years ago
Did you declare a primary key (using @Id JPA Annotation)? Does the view have a unique column that could act as the Id? T
This order by error is almost always a result of that. If your view does not have a unique column, consider concatenating two or more columns to create one.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
robr
over 9 years ago
I have a column I can use but I didn't think, within a database, I could identify a PK within a view. The XSD that creates the CDT has this in it:
@Table(name="ApplicationRTOsView")
</xsd:appinfo>
</xsd:annotation>
<xsd:sequence>
<xsd:element name="applicationRTO_ID" nillable="true" type="xsd:int">
<xsd:annotation>
<xsd:appinfo source="appian.jpa">
@Column(name="applicationRTO_ID", nullable=false)
@Id
@GeneratedValue
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
jesse.triplett
Appian Employee
over 9 years ago
Yes I only meant declare the PK in the CDT, which it appears was done. In the data in the view, is applicationRTO_ID unique or are there duplicate entries?
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel