Unable to make the account status as disabled for oraclejdbc

Hello Experts,

I was trying to make the account status for the jdbc accounts as disabled, without using the jdbc buildmap rule , with the use of making account query as
SELECT *,
CASE
WHEN user.status = 0 THEN 1
ELSE 0
END AS IIQDisabled
FROM user
LEFT JOIN usercapabilities
ON user.userid = usercapabilities.userid
ORDER BY user.userid;

my database is oracle jdbc
and I have added the IIQDisabled attribute to the schema and made it as boolean

but it was not working as expected , the value was not getting populated in the IIQDisabled attribute and the account status is being enabled only.

can someone help me out with this, It will be very helpful
Thanks in advance!
Tulasi

Hi @Tulasi ,

Please find below query. Adjust ‘true’ / ‘false’ based on the status code. Keep IIQDisabled type as “string” in schema

CASE WHEN user.status = ‘0’ THEN ‘true’ ELSE ‘false’
END AS IIQDisabled,

Hi @JackSparrow
We tried this approach but it didn’t work
Thanks for the response

If you’re okay with using a JDBC BuildMap rule, you can achieve the IIQDisabled mapping reliably using the following code snippet:

import sailpoint.connector.*;
import java.util.Map;

Map map = JDBCConnector.buildMapFromResultSet(result, schema);

if (map.containsKey(“active”) && map.get(“active”) != null) {
// Step 1: Get the boolean value
boolean isActive = (Boolean) map.get(“active”);
// Step 2: Convert to disabled flag
if (!isActive) {
map.put(“IIQDisabled”, true);
} else {
map.put(“IIQDisabled”, false);
}
}

return map;

This ensures:

  • If active = falseIIQDisabled = true (account shown as disabled in IIQ)
  • If active = trueIIQDisabled = false

Thanks for the response but the account attribute we use for the status mapping is status which is number not string, so not sure whether the above buildmap works are should we make any changes to it

import sailpoint.connector.*;
import java.util.Map;

Map map = JDBCConnector.buildMapFromResultSet(result, schema);

if (map.containsKey(“status”) && map.get(“status”) != null) {
int status = 0;
try {
status = Integer.parseInt(map.get(“status”).toString());
} catch (Exception e) {
status = 0; // default fallback
}
// Assuming 0 = disabled and 1 = active
if (status == 0) {
map.put(“IIQDisabled”, true);
} else {
map.put(“IIQDisabled”, false);
}
}

return map;

JDBCConnector.buildMapFromResultSet(result, schema) is not working anymore.

The Java Doc does not list JDBCConnector under classes anymore unlike DelimitedFileConnector and I can not access the class in my IDE.

Is there a way to access call the method buildMapFromResultSet in a BuildMap rule?

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.