# SQL Loader: IIQDisabled in select query

**URL:** <https://developer.sailpoint.com/discuss/t/sql-loader-iiqdisabled-in-select-query/71865>\
**Category:** SHF Discussion and Questions\
**Tags:** identity-security-cloud\
**Created:** [July 10, 2024, 8:44pm UTC](https://developer.sailpoint.com/discuss/t/sql-loader-iiqdisabled-in-select-query/71865 "2024-07-10T20:44:06Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![arshdeep\_thapar](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/arshdeep_thapar/32/15239_2.png) [@arshdeep\_thapar](https://developer.sailpoint.com/discuss/u/arshdeep_thapar)\
**Post date:** [July 10, 2024, 8:44pm UTC](https://developer.sailpoint.com/discuss/t/sql-loader-iiqdisabled-in-select-query/71865/1 "2024-07-10T20:44:07Z")

</div>

Hi

I am using SQLLoader for connecting with a delimited file.  
I want to mark the account as disabled if an attribute isActive is TRUE.

For that, i used this query, but everytime it’s returning IIQDisabled true:

select UserName, Name, CreatedDate, LastLogon, Module, isActive, IF(isActive =‘FALSE’, ‘true’, ‘false’) as IIQDisabled from acme\_test ORDER BY UserName ASC.

I even tried this query:

```auto
select UserName, Name, CreatedDate, LastLogon, Module, isActive, 
CASE 
WHEN isActive='TRUE' || isActive='True' THEN 'false'
ELSE 'true'
END AS IIQDisabled from acme_test ORDER BY UserName ASC

```

It gave the same result. IIQDisabled is always set to true.

Regards  
Arshdeep

---

<div class="post-metadata">

**Author:** ![enistriminsait](https://avatars.discourse-cdn.com/v4/letter/e/58f4c7/32.png) [@enistriminsait](https://developer.sailpoint.com/discuss/u/enistriminsait)\
**Post date:** [July 10, 2024, 9:23pm UTC](https://developer.sailpoint.com/discuss/t/sql-loader-iiqdisabled-in-select-query/71865/2 "2024-07-10T21:23:56Z")

</div>

> [@arshdeep\_thapar](#):
>
> SQLLoader

Hi @arshdeep_thapar,

check the type of isActive, if is a boolean try this:

```auto
select UserName, 
 Name, 
 CreatedDate,
 LastLogon, 
 Module,
 isActive,
 case
    when isActive = 0 // or isActive = '0'
    then 'True'
    else 'False'
 end as IIQDisabled 
from acme_test 
ORDER BY UserName ASC

```

alse, if it is a string

```auto
select UserName, 
 Name, 
 CreatedDate,
 LastLogon, 
 Module,
 isActive,
 case
    when lower(isActive) = 'false'
    then 'True'
    else 'False'
 end as IIQDisabled 
from acme_test 
ORDER BY UserName ASC

```

---

<div class="post-metadata">

**Author:** ![edmarks](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/edmarks/32/2896_2.png) [@edmarks](https://developer.sailpoint.com/discuss/u/edmarks)\
**Post date:** [July 10, 2024, 9:58pm UTC](https://developer.sailpoint.com/discuss/t/sql-loader-iiqdisabled-in-select-query/71865/3 "2024-07-10T21:58:45Z")

</div>

I agree with [Emanuele Nistri](https://developer.sailpoint.com/discuss/u/enistri). Knowing what type of field “IsActive” actually is the key to ensuring this works as expected. In addition to this providing a sample of the actual data from this SELECT would also be helpful along include “IsActive” as a field in the query to see what values it has in comparison to the calculated value.

---

<div class="post-metadata">

**Author:** ![arshdeep\_thapar](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/arshdeep_thapar/32/15239_2.png) [@arshdeep\_thapar](https://developer.sailpoint.com/discuss/u/arshdeep_thapar)\
**Post date:** [July 11, 2024, 5:03pm UTC](https://developer.sailpoint.com/discuss/t/sql-loader-iiqdisabled-in-select-query/71865/4 "2024-07-11T17:03:08Z")

</div>

This worked. Thank you.

---

<div class="post-metadata">

**Author:** ![arshdeep\_thapar](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/arshdeep_thapar/32/15239_2.png) [@arshdeep\_thapar](https://developer.sailpoint.com/discuss/u/arshdeep_thapar)\
**Post date:** [July 11, 2024, 5:03pm UTC](https://developer.sailpoint.com/discuss/t/sql-loader-iiqdisabled-in-select-query/71865/5 "2024-07-11T17:03:19Z")

</div>

Thanks, that solution worked.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/sailpoint/original/2X/f/f2136700ed5e3703e0b85e02f6be799dacca7735.png) [@system](https://developer.sailpoint.com/discuss/u/system)\
**Post date:** [September 9, 2024, 5:03pm UTC](https://developer.sailpoint.com/discuss/t/sql-loader-iiqdisabled-in-select-query/71865/6 "2024-09-09T17:03:24Z")

</div>

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