This week's book giveaway is in the Other Languages forum.
We're giving away four copies of Rust Web Development and have Bastian Gruber on-line!
See this thread for details.
Win a copy of Rust Web Development this week in the Other Languages forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

Issue while using a non-deterministic function in create mask return case statement

 
Ranch Hand
Posts: 157
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am trying to create an IBMi DB2 mask over a table as below:


The problem is with the IESWEBSERP.IES_CHECK_AUTH user defined function used in the RETURN CASE.

As per the documentation, I understand that the RETURN CASE statement cannot use a Non-Deterministic function. So below is how this udf is defined:


All the UDF does is it checks if value of field MSTCONTL.USRC2 is 'U' or 'P' for the user record of the current session user. If it is so, it returns a value of '1' which would allow the user to see the value of the field WSVNDPWD without any masking.

But the catch is that if the value MSTCONTL.USRC2 is updated to a value other than 'U' or 'P', the function would still return '1' (if '1' was returned earlier as well).. This I believe is because the function is defined as DETERMINISTIC.

If I make the function non DETERMINSTIC, the create mask statement fails. So I am not sure how to handle this situation. I want a "dynamic" result from the function. Please can someone advise how this can be handled?

 
reply
    Bookmark Topic Watch Topic
  • New Topic