The Community is now in read-only mode to prepare for the launch of the new Flexera Community. During this time, you will be unable to register, log in, or access customer resources. Click here for more information.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Category update with SQL query

FarrukhNaz
By
Level 6

As far as I'm aware, the Inventory Category property is not included in the reconciliation procedures and can be changed while the reconciliation operation is still in progress. 

I set up a daily job to update the Inventory device category with below mentioned SQL query that lookup the device operating system and then update its category desktop/server accordingly. However  I noticed that in the database categories are being updated in the [ComplianceComputer_MT] table but no change/visible in the All Inventory view, strange! but the following day it is visible in the 

Does anyone know why that is happening whereas earlier same query works without any issue?

 

 

--update category for clinets
UPDATE [FNMP].[dbo].[ComplianceComputer_MT]
SET [CategoryID] = '4.-1.-1.-4.'
 WHERE CategoryID IS NULL AND( [OperatingSystem] LIKE '%Windows 10%'
 OR [OperatingSystem] LIKE '%Windows 7%'
 OR [OperatingSystem] LIKE '%Windows 8.1%'
 OR [OperatingSystem] LIKE '%Windows Embedded%'
 OR [OperatingSystem] LIKE '%Windows XP%'
 OR [OperatingSystem] LIKE '%Windows version 6.2%'
OR [OperatingSystem] LIKE '%Windows 11%')

--update category for servers
UPDATE [FNMP].[dbo].[ComplianceComputer_MT]
SET [CategoryID] = '4.-1.-1.-1.'
WHERE [CategoryID] IS NULL AND (
[OperatingSystem] LIKE '%AIX%'  
OR [OperatingSystem] LIKE '%CentOS%'
OR [OperatingSystem] LIKE '%Debian%'
OR [OperatingSystem] LIKE '%EulerOS%'
OR [OperatingSystem] LIKE '%HP_UX%'
OR [OperatingSystem] LIKE '%Linux%'
OR [OperatingSystem] LIKE '%Server%'
OR [OperatingSystem] LIKE '%OneView%'
OR [OperatingSystem] LIKE '%OpenSUSE%'
OR [OperatingSystem] LIKE '%Solaris%'
OR [OperatingSystem] LIKE '%Red Hat%'
OR [OperatingSystem] LIKE '%RedHat%'
OR [OperatingSystem] LIKE '%RedHatEnterprise%'
OR [OperatingSystem] LIKE '%SLES%'
OR [OperatingSystem] LIKE '%SunOS%'
OR [OperatingSystem] LIKE '%Ubuntu%'
OR [OperatingSystem] LIKE '%Vmware%'
OR [OperatingSystem] LIKE '%Windows 2000%'
OR [OperatingSystem] LIKE '%Windows 2003%')

 

 Thanks

(1) Solution

mfranz
By Level 17 Champion
Level 17 Champion

Hi,

That might just be a bug/slow cache thing. I've had similar effects when bulk updating data.

EXEC SyncTable_Grid_ComputersListModel_PC
EXEC SyncAllTables

Maybe try one of these procedures. When run after your update, the system should sync so that All inventory shows the correct values.

Best regards,

Markward

View solution in original post

(3) Replies

mfranz
By Level 17 Champion
Level 17 Champion

Hi,

That might just be a bug/slow cache thing. I've had similar effects when bulk updating data.

EXEC SyncTable_Grid_ComputersListModel_PC
EXEC SyncAllTables

Maybe try one of these procedures. When run after your update, the system should sync so that All inventory shows the correct values.

Best regards,

Markward

Hi, 

Thanks, can we run these processes during a reconciliation that is already in progress? How long do these processes take?

BR,

Naz

__PRESENT

__PRESENT

mfranz
By Level 17 Champion
Level 17 Champion

From my experience, these syncs are rather quick and I believe the reconciliation should take care of these automatically. If you want to make sure that your changes from a business import are visible, maybe just add the execution as "custom script" directly to your import.