• 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 ...
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
  • Mikalai Zaikin

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

Ranch Hand
Posts: 160
  • 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?

Shiny ad:
a bit of art, as a gift, that will fit in a stocking
    Bookmark Topic Watch Topic
  • New Topic