Hi all ,
is there a way to minimize a large switch statement by using dynamic variable ,
my job look like this :
static void Job12(Args _args){
EcoResCategory a,b;
Container res;
str s1,s2,s3,s4,s5,s6;
SELECT firstonly a where a.CategoryHierarchy == 45677731554 ;
while select b order by b.Level asc
where b.CategoryHierarchy == a.CategoryHierarchy
&& b.NestedSetLeft <= a.NestedSetLeft
&& b.NestedSetRight >= a.NestedSetLeft
{
switch(b.Level) {
case 1:
s1 = = b.Name;
break;
case 2:
s1 = = b.Name;
break;
case 3:
s1 = = b.Name;
break;
case 4:
s1 = = b.Name;
break;
case 5:
s1 = = b.Name;
break;
case 6:
s1 = = b.Name;
break;
}
}
res = [s1,s2,s3,s4,s5,s6]
}