Notifications
Announcements
No record found.
hi ,
In my form i have declare two tables which contains same enum type filed i want to use this field in select query in where condition to compare the same value
pls help
*This post is locked for comments
Hi,
I am not sure i understand it completely but it is very simple, see sample selects,
if you want to select on any specific enum value
select firstonly yourTable1 where yourTable1.yourEnumField = YourEnum::Value;
if you want to select based on your other table then you have to maintain a jon between the two.
select yourTable1 join yourTable2
where yourTable1.yourEnumField == yourTable2.yourEnumField;
or iterate on first table with while loop to pass the enum value to second table select.
Thanks
Amir
https://msdax.wordpress.com
i tried using
where yourTable1.yourEnumField == yourTable2.yourEnumField
but getting error operand type not compactible
this error happen when you dont have the same base type on fields. check the EnumType or EDT property on field. it should needs to be same
You are correct it is not same now how to tackle this scenario i want to use this in select query where clause only to match the transaction type any other suggestion pls provide
My first question is why you have different enum or EDT while you have similar data in tables ?
other approach would be not my personal but you can use that. you have to create the mapping of enum values suppose you have below structure of table
table1, field1, enum1 with values (Eval1,Eval2)table2, field1, enum2 with values (Eval3,Eval4)
u have to create the mapping method like
Enum2 getEnum2mapping (Enum1 _enum1){ if (_enum1 == Enum1::Eval1) return Enum2::Eval3; else return Enum2::Eval4;}
you use the method in code
Table1 table1;Table2 table2;Enum2 enum2Var;
while select field1 from table1{ enum2Var = getEnum2mapping (table1.field1); // calling the mapping method
select * from table2 where table2.field1 = enum2Var; // here you can get the result}
ThanksAmirhttps:://msdax.wordpress.com
because in table2 enum only few values from table1 enum is there. that the reson edt type is different
my question is
table1, field1, enum1 with values (Eval1,Eval2)
this is hardcode i have to do eval1 eval2..
Can you pls elaborate it how to write the above code in my forms where do i specify this method
my forms are Security transaction and other is Precleance breach and both is having field Trancsaction type with enum ITL_COC_TransactionType and other is ITL_COC_PreclType
pls elaborated in forms coding
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Priya_K 4
Martin Dráb 4 Most Valuable Professional
Ali Zaidi 2