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
7 replies
Subscribers
7 subscribers
Views
4994 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
General
Query Entity
anilkumark
over 7 years ago
How to implement NVL() in Appian? Can any one help me how to implement below query using queryEntity().
select * from REQUEST
where XYZ is null
and PQR is null
and NVL(NEW_CD, OLD_CD) IN (1,2,3);
Thanks!
OriginalPostID-233682
Discussion posts and replies are publicly visible
0
Jacob Cohen - Project Leader - Macedon Technologies
over 7 years ago
You cannot do this directly with query entity, but you could apply over the result with a APN_replaceNull from Appian Common Objects.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
anilkumark
over 7 years ago
But here, I am not not fetching NEW_CD and OLD_CD. Based on the NVL condition I want to fetch the records. How APN_replaceNull helps?
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Jacob Cohen - Project Leader - Macedon Technologies
over 7 years ago
You would need to query for both columns. Then replace the null values of the one column with the results of the other.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Jacob Cohen - Project Leader - Macedon Technologies
over 7 years ago
In other words, you would need to do some processing on the Appian side in addition to the database side.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Dan Lluhi
Certified Lead Developer
over 7 years ago
You could also create a database view for your REQUEST table, creating a new column for NVL(NEW_CD, OLD_CD). Then through your Appian queryEntity, have a filter to check where this new column is IN (1,2,3).
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
anilkumark
over 7 years ago
Yes, view is the best option. But we don't have time. Trying from Appian side to resolve this issue. How to get the records from REQUEST CDt variable where NEW_CD IN (1,2,3)?
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Dan Lluhi
Certified Lead Developer
over 7 years ago
I think you can accomplish this by using logicalExpressions. You can use logicalExpressions to combine filters, so for example you could make a logicalExpression that checks if NEW_CD IN (1,2,3) OR (NEW_CD is null AND OLD_CD in (1,2,3)) .Check out this link:
forum.appian.com/.../System_Functions.html
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel