HP Device Manager 4.5 - Database Schema Guide

63
Examples
Generate device information
1. We need all devices of all OS types and only need the device’s name and status (which should be ON).
We can use the Device Report function to generate results, but it contains ALL of the columns, so we
need to write SQL statements (connecting to Database Server) to generate the desired results.
a. We need device information. In the
Device-related tables category, locate the table dm_devices.
b. Write the SQL statements: (only the device name, and if the status is on)
select device_name, active
from DB_NAME.dbo.dm_devices
where dm_devices.active = 'on';
c. The results should be as shown below:
2. We want to know which devices don’t use auto-map FTP from the results above.
a. Locate the device FTP mapping table: dm_repo_mapping.
b. Join the two tables: dm_devices, dm_repo_mapping:
Select dm_devices.device_NAME, dm_devices.active
from DB_NAME.dbo.dm_devices, DB_NAME.dbo.dm_repo_mapping
where dm_devices.active = 'on' and dm_devices.device_id = dm_repo_mapping.map_key
and dm_repo_mapping.category = 3;
c. The results should be as shown below: