Java Stored Procedure changeSSN Documentation
02/22/2008
-------------------------------------------------------------------------------------------
Java Stored Procedure changeSSN (called by UDBPROD stored procedure FSHTDG.SEC_CHANGESSN)
This procedure corrects SSNs in the FSHTDG.USER_ACCT table.
-------------------------------------------------------------------------------------------
Input parameters:
String oldSSN CHAR(9) The old SSN to be replaced Cannot be null
String newSSN CHAR(9) The new SSN to replace it Cannot be null
String updatedBy VARCHAR(20) Identifier of calling process Cannot be null
Output parameter:
int result INT(10) The resulting value. Possible values:
1 SSN successfully changed
0 oldSSN already exists, or some other logic error
-1 Database error
Processing Summary:
-------------------
If the old SSN does not exist in the database, nothing happens.
If the new SSN already exists in the database, the oldSSN account is deactivated.
If the new SSN does not exist in the database, the oldSSN account is updated with newSSN.
This proc also updates the LDAP.
Processing Detail:
-------------------
If any of the three input parameters is null, result is set to -1 and processing ends
Gets the calling proc's connection to FSHTDG database @UDBPROD
Looks for userkey, fsusn from FSHTDG.USER_ACCT where person_id = oldSSN
If account for oldSSN does NOT exist in FSHTDG.USER_ACCT:
Else (account for oldSSN does exist):
Looks for userkey, fsusn from FSHTDG.USER_ACCT where person_id = newSSN
If account for the newSSN exists:
Disables the old account by setting FSHTDG.USER_ACCT.ACTIVE_FLG = 'N'
Makes sure new account is active by setting FSHTDG.USER_ACCT.ACTIVE_FLG = 'Y'
Sets result = 1
Makes same changes to LDAP
Else (account for the newSSN does NOT exist):
Sets the oldSSN acct to the newSSN acct by:
Setting FSHTDG.USER_ACCT.PERSON_ID = newSSN
Setting FSHTDG.USER_ACCT.ACTIVE_FLG = 'Y'
Sets result = 1
Makes same changes to LDAP
--Fred
|