Monday, May 21, 2012

Unable To Pass NULL Values Parameters To The Package API FND_USER_PKG



Unable To Pass NULL Values Parameters To The Package API FND_USER_PKG 

Symptoms

You want to run the API Fnd_User_Pkg.UpdateUser in order to update the two fields x_password_accesses_left  and x_password_lifespan_accesses with the value NULL like :
fnd_user_pkg.UpdateUser (
          x_user_name             => l_user_name,
          x_owner                 => null,
          x_password_accesses_left     => null,
          x_password_lifespan_accesses => null,
          x_password_date         => sysdate);
    end;
    /

After running fnd_user_pkg.UpdateUser, the two columns password_accesses_left  and password_lifespan_accesses of the table FND_USER are not updated to null and stay at their original values .
Cause

To set the null value, you must set fnd_user_pkg.null_number to password_accesses_left and password_lifespan_accesses.
Solution

Please use the function fnd_user_pkg.null_number to set parameters to null :
set serveroutput on
    declare
    l_user_name varchar2(2000);
    begin
    l_user_name := 'PDUVAL';
    fnd_user_pkg.UpdateUser (
          x_user_name             => l_user_name,
          x_owner                 => null,
          x_password_accesses_left     => fnd_user_pkg.null_number,
          x_password_lifespan_accesses => fnd_user_pkg.null_number,
          x_password_date         => sysdate);
    end;
    /

No comments:

Post a Comment