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
1827 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
AI and Rules
Character/Numeric Issues Query Entity Rules
georgej
over 7 years ago
Hi Team,
We have query entity rule(say QREntity) which gets rows from table based on the input passed.
It's like fieldA = ri!input. (fieldA in db is defined as Numeric)
ri!input is defined as numeric. I am invoking this rule from another rule as below
with(
local!input:8,
rule!QREntity(local!input)
). It works without any issues. But if change it as below
with(
local!input:"8",
rule!QREntity(local!input)
). Then also surprisingly no issues. My question is doesn't it matter the data type of variable passed while executing the Query Entity Rule. This question is asked in the backdrop of a DB change where we are converting a numeric DB Field to Text.
If the rule works without any issues ,then we need not change lot of rules which are passing the parameter as numeric.
OriginalPostID-232657
Discussion posts and replies are publicly visible
0
aayusha
Certified Senior Developer
over 7 years ago
As far as I have seen till now, it should not create any issues as you are converting a integer column to text but ideally all the dependencies should be changed.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
aayusha
Certified Senior Developer
over 7 years ago
I should say It is a good practice to change and keep this consistent.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
georgej
over 7 years ago
Certainly, but we would like to have more insight into the behavior highlighted in the question. How APPIAN is interpreting the data type ,though it is defined as numeric but is accepting both text/numeric
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
PhilB
A Score Level 1
over 7 years ago
I think this is probably more of a database question than query entity, as ultimately your query entity will eventually end up as a SQL query. Try running the following one at a time, and I think you'll have the answer to your question:
select 1 !=1; -- should be 0 (ie false)
select 8 = 8; -- should be 1 (ie true)
select '8' = 8; -- should be 1 (ie true)
Out of interest, are you converting the primary key field to text, and/or doing the same with a field that you use as a way of finding rows? If so you may want to consider the effects that converting to text will have on the table indexes, as well as how you're going to ensure that column is unique.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel